mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
github-remove updates (#9990)
additional .gitignore file to restore maybe make work on python < 2.7
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user