Run tlwiki script with a default set of options when run as a git pre-push hook
This commit is contained in:
parent
715dde950a
commit
85c571a880
5
tlwiki
5
tlwiki
|
@ -4,6 +4,7 @@
|
||||||
import argparse
|
import argparse
|
||||||
import yaml
|
import yaml
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
# Valid commands
|
# Valid commands
|
||||||
|
@ -25,8 +26,12 @@ parser.add_argument('--config', '-c',
|
||||||
type=argparse.FileType('r'),
|
type=argparse.FileType('r'),
|
||||||
help='Configuration file')
|
help='Configuration file')
|
||||||
|
|
||||||
|
if sys.argv[0] == '.git/hooks/pre-push':
|
||||||
|
args = parser.parse_args(['deploy'])
|
||||||
|
else:
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
# load config yaml into config dict
|
# load config yaml into config dict
|
||||||
config = yaml.safe_load(args.config)
|
config = yaml.safe_load(args.config)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue