1
1
#!/usr/bin/env python3
2
2
3
- import sys , db , updown , config
3
+ import os , sys , db , updown , config
4
4
5
5
def main (command , target ):
6
6
@@ -25,7 +25,9 @@ def main(command, target):
25
25
print ("[+] Successfully exported history to {}" .format (target ))
26
26
27
27
elif command == "save" :
28
+ workDir = os .getcwd ()
28
29
for tar in target .split (',' ):
30
+ os .chdir (workDir )
29
31
res = db .saveOne (tar )
30
32
if res == 1 :
31
33
print ("[!] Could not find {} in local history" .format (tar ))
@@ -35,7 +37,9 @@ def main(command, target):
35
37
print ("[+] Successfully saved {} to local directory" .format (tar ))
36
38
37
39
elif command == "import" :
40
+ workDir = os .getcwd ()
38
41
for tar in target .split (',' ):
42
+ os .chdir (workDir )
39
43
res = db .importDb (tar )
40
44
if res == 1 :
41
45
print ("[!] Could not read {}" .format (tar ))
@@ -47,7 +51,9 @@ def main(command, target):
47
51
print ("[+] Successfully imported {}" .format (tar ))
48
52
49
53
elif command == "delete" :
54
+ workDir = os .getcwd ()
50
55
for tar in target .split (',' ):
56
+ os .chdir (workDir )
51
57
res = db .deleteItem (tar )
52
58
if res == 1 :
53
59
print ("[!] Could not find {} in history" .format (tar ))
@@ -57,7 +63,9 @@ def main(command, target):
57
63
print ("[+] Successfully deleted {} from history" .format (tar ))
58
64
59
65
elif command == "upload" :
66
+ workDir = os .getcwd ()
60
67
for tar in target .split (',' ):
68
+ os .chdir (workDir )
61
69
res = updown .uploadFile (tar )
62
70
if res == 1 :
63
71
print ("[!] Could not find {}" .format (tar ))
@@ -71,7 +79,9 @@ def main(command, target):
71
79
print ("[+] Successfully uploaded {}" .format (tar ))
72
80
73
81
elif command == "download" :
82
+ workDir = os .getcwd ()
74
83
for tar in target .split (',' ):
84
+ os .chdir (workDir )
75
85
res = updown .downloadFile (tar )
76
86
if res == 1 :
77
87
print ("[!] Could not retrieve {} from history" .format (tar ))
0 commit comments