@@ -15,20 +15,18 @@ class ScriptRunner
15
15
# For an exception running the script
16
16
class ScriptException < RuntimeError ; end
17
17
18
- attr_reader :script , :script_src , :logger , :stdout , :stderr , :exitcode , :existing_tempdir
18
+ attr_reader :script , :script_src , :logger , :stdout , :stderr , :exitcode
19
19
20
20
# Create the object - the object is a configured script, which can be executed multiple
21
21
# times with different environment varibles.
22
22
#
23
23
# @param opts [Hash] Options hash
24
24
# opts[:default_script] (Required) Path to script, relative to `scripts` directory
25
25
# opts[:logger] (Optional) Logger object
26
- # opts[:existing_tempdir] (Optional) An existing temporary directory (helpful when parallelizing)
27
26
# opts[:override_script_path] (Optional) Directory where a similarly-named script MAY exist
28
27
def initialize ( opts = { } )
29
28
@logger = opts [ :logger ]
30
29
@script_src = find_script ( opts . fetch ( :default_script ) , opts [ :override_script_path ] )
31
- @existing_tempdir = opts [ :existing_tempdir ]
32
30
@script = temp_script ( @script_src )
33
31
@stdout = nil
34
32
@stderr = nil
@@ -95,7 +93,7 @@ def log(priority, message, logger = @logger)
95
93
# @return [String] Path to tempfile containing script
96
94
def temp_script ( script )
97
95
raise Errno ::ENOENT , "Script '#{ script } ' not found" unless File . file? ( script )
98
- temp_dir = OctocatalogDiff ::Util ::Util . temp_dir ( 'ocd-scriptrunner' , existing_tempdir )
96
+ temp_dir = OctocatalogDiff ::Util ::Util . temp_dir ( 'ocd-scriptrunner' )
99
97
temp_file = File . join ( temp_dir , File . basename ( script ) )
100
98
File . open ( temp_file , 'w' ) { |f | f . write ( File . read ( script ) ) }
101
99
FileUtils . chmod 0o755 , temp_file
0 commit comments