Skip to content

Commit d38c198

Browse files
committed
Tweak sed command for replacing documentation resources
Modify sed to not use backup files (modify in place) when cleaning up documentation stylesheets/javascript, due to the differences between gnu sed and OS X sed the command is slightly different on each platform.
1 parent 7b5cc25 commit d38c198

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Rakefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,14 @@ task :update_docs, [:version, :branch, :website_path] do |t, args|
6666
cmd = "bundle install && RUBYOPT='-I#{args[:website_path]}/lib' bundle exec yard --plugin rspec-docs-template --output-dir #{args[:website_path]}/source/documentation/#{args[:version]}/#{project}/"
6767
puts cmd
6868
Bundler.clean_system(cmd)
69-
Bundler.clean_system %Q{pushd #{args[:website_path]}; ag -l href=\\"\\\(?:..\/\\\)*css | xargs -I{} sed -ibak 's/href="\\\(..\\\/\\\)*css/href="\\\/stylesheets\\\/docs/' {}; popd}
70-
Bundler.clean_system %Q{pushd #{args[:website_path]}; ag -l src=\\"\\\(?:..\/\\\)*js | xargs -I{} sed -ibak 's/src="\\\(..\\\/\\\)*js/src="\\\/javascripts\\\/docs/' {}; popd}
69+
in_place =
70+
if RUBY_PLATFORM =~ /darwin/ # if this is os x then we must modify sed
71+
"-i ''"
72+
else
73+
"-i''"
74+
end
75+
Bundler.clean_system %Q{pushd #{args[:website_path]}; ag -l href=\\"\\\(?:..\/\\\)*css | xargs -I{} sed #{in_place} 's/href="\\\(..\\\/\\\)*css/href="\\\/stylesheets\\\/docs/' {}; popd}
76+
Bundler.clean_system %Q{pushd #{args[:website_path]}; ag -l src=\\"\\\(?:..\/\\\)*js | xargs -I{} sed #{in_place} 's/src="\\\(..\\\/\\\)*js/src="\\\/javascripts\\\/docs/' {}; popd}
7177
end
7278
end
7379

0 commit comments

Comments
 (0)