-
Notifications
You must be signed in to change notification settings - Fork 0
/
push
executable file
·39 lines (32 loc) · 954 Bytes
/
push
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
import sys
from invoke import Program, Collection
from invoke.config import Config, merge_dicts
# do not write bytecode
sys.dont_write_bytecode = True
# this modifies the config file searching and makes it search for these files:
# /etc/push.yaml
# ~/.push.yaml
# push.yaml
# PUSH_RUN_ECHO <- environment variable example
class AppConfig(Config):
prefix = "push"
@staticmethod
def global_defaults():
their_defaults = Config.global_defaults()
my_defaults = {
"run": {
"echo": True,
"pty": True,
},
}
return merge_dicts(their_defaults, my_defaults)
if (__name__ == "__main__"):
from pushlib import loader, __version__
program = Program(
binary="push",
version=__version__,
config_class=AppConfig,
namespace=Collection.from_module(loader),
)
sys.exit(program.run())