diff options
author | Keith Pitt <me@keithpitt.com> | 2014-10-08 16:33:53 +0800 |
---|---|---|
committer | Keith Pitt <me@keithpitt.com> | 2014-10-08 16:33:53 +0800 |
commit | 4c7da578f200f0bc721cc2cae27eb2b25f96e8dd (patch) | |
tree | 565b5b7746bc2cff8e46883b4d1836dfaa0246ef /doc/development/shell_commands.md | |
parent | 76594d474ca6d04c2e608e7b3df1229729288f14 (diff) | |
parent | 928178deb9d582d7537a57983ff9e695f07dab1f (diff) | |
download | gitlab-ce-4c7da578f200f0bc721cc2cae27eb2b25f96e8dd.tar.gz |
Merge branch 'master' into buildbox-service
Conflicts:
app/models/project.rb
Diffstat (limited to 'doc/development/shell_commands.md')
-rw-r--r-- | doc/development/shell_commands.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/development/shell_commands.md b/doc/development/shell_commands.md index 1f3908f4e27..23c8365c340 100644 --- a/doc/development/shell_commands.md +++ b/doc/development/shell_commands.md @@ -22,6 +22,12 @@ FileUtils.mkdir_p "tmp/special/directory" contents = `cat #{filename}` # Correct contents = File.read(filename) + +# Sometimes a shell command is just the best solution. The example below has no +# user input, and is hard to implement correctly in Ruby: delete all files and +# directories older than 120 minutes under /some/path, but not /some/path +# itself. +Gitlab::Popen.popen(%W(find /some/path -not -path /some/path -mmin +120 -delete)) ``` This coding style could have prevented CVE-2013-4490. |