lib/docman/commands/execute_script_cmd.rb in docman-0.0.45 vs lib/docman/commands/execute_script_cmd.rb in docman-0.0.46

- old
+ new

@@ -18,10 +18,14 @@ def execute Dir.chdir self['execution_dir'] logger.info "Script execution: #{self['location']}" params = self['params'].nil? ? '' : prepare_params(self['params']) - `chmod 777 #{self['location']}` + + # Fix for ^M issue when saved from GitLab or windows. + `cat #{self['location']} | tr -d '\r' > #{self['location']}-tmp` + `rm -f #{self['location']}` + `mv #{self['location']}-tmp #{self['location']}` `chmod a+x #{self['location']}` logger.info `#{self['location']} #{params}` $?.exitstatus end \ No newline at end of file