Fix error in usage of mkstemp function output
This commit is contained in:
parent
c9c34353fc
commit
2cc57c32b7
@ -1,7 +1,8 @@
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
import tempfile
|
||||
|
||||
CONSTRUCTED_CONFIG_FILE = "/tmp/runner-config.json"
|
||||
|
||||
|
||||
def main() -> str:
|
||||
@ -20,12 +21,10 @@ def main() -> str:
|
||||
print(f"Missing required configuration value {err}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
path = tempfile.mkstemp(prefix="semaphore-runner-")
|
||||
|
||||
with open(path, "w") as outfile:
|
||||
with open(CONSTRUCTED_CONFIG_FILE, "w") as outfile:
|
||||
json.dump(config, outfile, indent=4)
|
||||
|
||||
return path
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
semaphore runner --config="$(python /configure.py)"
|
||||
python /configure.py
|
||||
|
||||
semaphore runner --config=/tmp/runner-config.json
|
||||
|
Loading…
Reference in New Issue
Block a user