File: dumpenv

package info (click to toggle)
ostree-push 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: python: 3,650; makefile: 10
file content (19 lines) | stat: -rwxr-xr-x 310 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python3

# Dump argv and environ in JSON

import json
import os
import sys

data = {
    'args': sys.argv,
    'env': dict(os.environ),
}

dest_path = os.getenv('DUMPENV_DEST')
if dest_path:
    dest = open(dest_path, 'w')
else:
    dest = sys.stdout
json.dump(data, dest, indent=2, sort_keys=True)