Skip to content

Commit fdba6fe

Browse files
authored
Update skyhook
1 parent 5382582 commit fdba6fe

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

skyhook

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
import sys, db, updown, config
3+
import os, sys, db, updown, config
44

55
def main(command, target):
66

@@ -25,7 +25,9 @@ def main(command, target):
2525
print("[+] Successfully exported history to {}".format(target))
2626

2727
elif command == "save":
28+
workDir = os.getcwd()
2829
for tar in target.split(','):
30+
os.chdir(workDir)
2931
res = db.saveOne(tar)
3032
if res == 1:
3133
print("[!] Could not find {} in local history".format(tar))
@@ -35,7 +37,9 @@ def main(command, target):
3537
print("[+] Successfully saved {} to local directory".format(tar))
3638

3739
elif command == "import":
40+
workDir = os.getcwd()
3841
for tar in target.split(','):
42+
os.chdir(workDir)
3943
res = db.importDb(tar)
4044
if res == 1:
4145
print("[!] Could not read {}".format(tar))
@@ -47,7 +51,9 @@ def main(command, target):
4751
print("[+] Successfully imported {}".format(tar))
4852

4953
elif command == "delete":
54+
workDir = os.getcwd()
5055
for tar in target.split(','):
56+
os.chdir(workDir)
5157
res = db.deleteItem(tar)
5258
if res == 1:
5359
print("[!] Could not find {} in history".format(tar))
@@ -57,7 +63,9 @@ def main(command, target):
5763
print("[+] Successfully deleted {} from history".format(tar))
5864

5965
elif command == "upload":
66+
workDir = os.getcwd()
6067
for tar in target.split(','):
68+
os.chdir(workDir)
6169
res = updown.uploadFile(tar)
6270
if res == 1:
6371
print("[!] Could not find {}".format(tar))
@@ -71,7 +79,9 @@ def main(command, target):
7179
print("[+] Successfully uploaded {}".format(tar))
7280

7381
elif command == "download":
82+
workDir = os.getcwd()
7483
for tar in target.split(','):
84+
os.chdir(workDir)
7585
res = updown.downloadFile(tar)
7686
if res == 1:
7787
print("[!] Could not retrieve {} from history".format(tar))

0 commit comments

Comments
 (0)