github-remove updates (#9990)

additional .gitignore file to restore
maybe make work on python < 2.7
This commit is contained in:
Tony Murray
2019-03-18 21:25:16 -05:00
committed by GitHub
parent 1ae3a7fa58
commit 8f48f6a7cc

View File

@@ -1,6 +1,6 @@
#! /usr/bin/env python
import argparse, datetime, sys
from subprocess import call, check_output
import argparse, datetime, sys, subprocess
from subprocess import call, Popen
from os.path import dirname, abspath
raw_input = getattr(__builtins__, 'raw_input', input)
@@ -41,6 +41,7 @@ if args.discard:
'storage/app/public/.gitignore',
'storage/debugbar/.gitignore',
'storage/framework/cache/.gitignore',
'storage/framework/cache/data/.gitignore',
'storage/framework/sessions/.gitignore',
'storage/framework/testing/.gitignore',
'storage/framework/views/.gitignore',
@@ -60,8 +61,9 @@ elif args.save:
call(["git", "stash", "save", msg], cwd=librenms_dir)
elif args.restore:
list = check_output(["git", "stash", "list"])
last = list.decode("utf-8") .split('\n', 1)[0]
p = Popen(["git", "stash", "list"], stdout=subprocess.PIPE)
out, err = p.communicate()
last = out.decode("utf-8") .split('\n', 1)[0]
if "github-remove" in last:
call(["git", "stash", "pop"], cwd=librenms_dir)