Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- basic ruby script not working as expected
- def performCommandInDir(command, dir)
- old_dir = Dir.pwd
- Dir.chdir(dir)
- system(command)
- Dir.chdir(old_dir)
- end
- performCommandInDir("git svn rebase", repo[:name])
- fatal: /usr/libexec/git-core/git-rebase cannot be used without a working tree.
- rebase refs/remotes/git-svn: command returned error: 1
- system("git --git-dir=#{repo[:name]}/.git --work-tree=#{repo[:name]} svn rebase")
- def performCommandInDir(command, dir)
- system(command, :chdir => dir)
- end
- Dir.chdir(dir) do
- # your actions
- end
- # back in the original directory
- def performCommandInDir(command, dir)
- system("cd #{dir} && #{command}")
- end
Advertisement
Add Comment
Please, Sign In to add comment