summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authordearblue <[email protected]>2019-12-21 17:25:22 +0900
committerdearblue <[email protected]>2019-12-21 17:25:22 +0900
commitacef52c35e6e4e9c28c0478cbe5acd63820de7d7 (patch)
treec34e2e9ecb0cd0ef152eb5dff4163a067a2f73b1 /lib
parent5cc595cb2a057deff4c123425c9384f8e59e5e34 (diff)
downloadmruby-acef52c35e6e4e9c28c0478cbe5acd63820de7d7.tar.gz
mruby-acef52c35e6e4e9c28c0478cbe5acd63820de7d7.zip
Perform `shellquote` on referenced string
Diffstat (limited to 'lib')
-rw-r--r--lib/mruby/build/command.rb14
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)