Compare commits

...
Author SHA1 Message Date
Duo Developerandadmin b9d8c82f19 Remove unused temp dir variables that leaked on every invocation
utils_dir, temp_dir, build_dir, and staging_dir were computed at
module level but never referenced. tempfile.mkdtemp() ran
unconditionally on every invocation (including --help and
argument-parse errors), leaking an empty temp directory on disk
each time. Remove all four variables and the now-unused tempfile
import.
2026-08-28 09:51:24 +00:00
+1 -5
View File
@@ -1,6 +1,6 @@
#! /usr/bin/env python3
import sys, os, argparse, json, shutil, tempfile, subprocess, traceback
import sys, os, argparse, json, shutil, subprocess, traceback
def run_script(script_path: str) -> int:
"""
@@ -131,10 +131,6 @@ def uninstall_app(args: argparse.Namespace, install_path) -> int:
return rval
# script constants
utils_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
temp_dir = tempfile.mkdtemp()
build_dir = os.path.join(temp_dir, 'build')
staging_dir = os.path.join(temp_dir, 'staging')
working_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
src_path = os.path.join(working_dir, 'src')
CONFIG_JSON = os.path.join(working_dir, 'config.json')