Skip to content

Commit

Permalink
debug: try to find the current script
Browse files Browse the repository at this point in the history
  • Loading branch information
maltfield committed Jul 28, 2024
1 parent 40276ce commit 6d8aa31
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/packages/buskill/root_child_mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,40 @@ def trigger_softshutdown_mac_halt():
# * https://github.com/BusKill/buskill-app/issues/14#issuecomment-1279975783
# * https://github.com/BusKill/buskill-app/issues/77#issuecomment-2254299923

msg = "sys.path:|" +str(sys.path)+ "|"
logging.info(msg)

msg = "sys.argv:|" +str(sys.argv)+ "|"
logging.info(msg)

msg = "sys.executable:|" +str(sys.executable)+ "|"
logging.info(msg)

msg = "sys.prefix:|" +str(sys.prefix)+ "|"
logging.info(msg)

msg = "os.environ:|" +str(os.environ)+ "|"
logging.info(msg)

msg = "os.getcwd():|" +str(os.getcwd())+ "|"
logging.info(msg)

msg = "__file__:|" +str(__file__)+ "|"
logging.info(msg)

msg = "sys._getframe().f_code.co_filename:|" +str(sys._getframe().f_code.co_filename)+ "|"
logging.info(msg)

import inspect
msg = "inspect.getfile(inspect.currentframe()):|" +str(inspect.getfile(inspect.currentframe()))+ "|"
logging.info(msg)

msg = "inspect.stack():|" +str(inspect.stack())+ "|"
logging.info(msg)

msg = "inspect.getfile(inspect.currentframe()):|" +str(inspect.getfile(inspect.currentframe()))+ "|"
logging.info(msg)

our_filepath = os.path.abspath(__file__)

msg = "Attempting to harden ourselves " +str(our_filepath)
Expand Down

0 comments on commit 6d8aa31

Please sign in to comment.