diff options
| author | dearblue <[email protected]> | 2019-12-21 17:25:22 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2019-12-21 17:25:22 +0900 |
| commit | acef52c35e6e4e9c28c0478cbe5acd63820de7d7 (patch) | |
| tree | c34e2e9ecb0cd0ef152eb5dff4163a067a2f73b1 /lib | |
| parent | 5cc595cb2a057deff4c123425c9384f8e59e5e34 (diff) | |
| download | mruby-acef52c35e6e4e9c28c0478cbe5acd63820de7d7.tar.gz mruby-acef52c35e6e4e9c28c0478cbe5acd63820de7d7.zip | |
Perform `shellquote` on referenced string
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mruby/build/command.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 0a6d6b818..2b26ad20b 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -286,29 +286,29 @@ module MRuby @command = 'git' @flags = %w[] @clone_options = "clone %{flags} %{url} %{dir}" - @pull_options = "--git-dir #{shellquote("%{repo_dir}/.git")} --work-tree #{shellquote("%{repo_dir}")} pull" - @checkout_options = "--git-dir #{shellquote("%{repo_dir}/.git")} --work-tree #{shellquote("%{repo_dir}")} checkout %{checksum_hash}" - @reset_options = "--git-dir #{shellquote("%{repo_dir}/.git")} --work-tree #{shellquote("%{repo_dir}")} reset %{checksum_hash}" + @pull_options = "--git-dir %{repo_dir}/.git --work-tree %{repo_dir} pull" + @checkout_options = "--git-dir %{repo_dir}/.git --work-tree %{repo_dir} checkout %{checksum_hash}" + @reset_options = "--git-dir %{repo_dir}/.git --work-tree %{repo_dir} reset %{checksum_hash}" end def run_clone(dir, url, _flags = []) _pp "GIT", url, dir.relative_path - _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } + _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => shellquote(url), :dir => shellquote(filename(dir)) } end def run_pull(dir, url) _pp "GIT PULL", url, dir.relative_path - _run pull_options, { :repo_dir => dir } + _run pull_options, { :repo_dir => shellquote(dir) } end def run_checkout(dir, checksum_hash) _pp "GIT CHECKOUT", checksum_hash - _run checkout_options, { :checksum_hash => checksum_hash, :repo_dir => dir } + _run checkout_options, { :checksum_hash => checksum_hash, :repo_dir => shellquote(dir) } end def run_reset_hard(dir, checksum_hash) _pp "GIT RESET", checksum_hash - _run reset_options, { :checksum_hash => checksum_hash, :repo_dir => dir } + _run reset_options, { :checksum_hash => checksum_hash, :repo_dir => shellquote(dir) } end def commit_hash(dir) |
