lib/divvy/plugins/file_utilities.rb in mdwan-divvy-0.1.1 vs lib/divvy/plugins/file_utilities.rb in mdwan-divvy-0.1.2

- old
+ new

@@ -8,9 +8,15 @@ def mkdir(path, mode = nil) run("[ -d #{path} ] || mkdir -p #{path}") run("chmod #{mode} #{dir}") unless mode.nil? end + def push_text(path, text) + run("[ -f #{path} ] || touch #{path}") + run("echo '#{text}' | tee -a #{path}") + # "echo '#{text}' |#{'sudo' if option?(:sudo)} tee -a #{path}" + end + end end end register_plugin(Divvy::Plugins::FileUtilities) \ No newline at end of file