Revert "Don't require TO_DIR argument if action is TIDY,"
This change was not necessary (TO_DIR was never required), the wrong behaviour I was seeing was due to a different bug (which has been fixed by commitec76c782c6
). This reverts commitbc6bd6c777
. Conflicts: dotfilemanager.py
This commit is contained in:
parent
db4dab0953
commit
04172f4c40
@ -167,29 +167,33 @@ if __name__ == "__main__":
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
print usage()
|
print usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
FROM_DIR = sys.argv[2]
|
FROM_DIR = sys.argv[2]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
FROM_DIR = '~'
|
FROM_DIR = '~'
|
||||||
FROM_DIR = os.path.abspath(os.path.expanduser(FROM_DIR))
|
FROM_DIR = os.path.abspath(os.path.expanduser(FROM_DIR))
|
||||||
|
|
||||||
if not os.path.isdir(FROM_DIR):
|
if not os.path.isdir(FROM_DIR):
|
||||||
print "FROM_DIR %s is not a directory!" % FROM_DIR
|
print "FROM_DIR %s is not a directory!" % FROM_DIR
|
||||||
print usage()
|
print usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
if ACTION == 'tidy':
|
|
||||||
tidy(FROM_DIR)
|
|
||||||
else:
|
|
||||||
try:
|
try:
|
||||||
TO_DIR = sys.argv[3]
|
TO_DIR = sys.argv[3]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
TO_DIR = os.path.join('~','.dotfiles')
|
TO_DIR = os.path.join('~','.dotfiles')
|
||||||
TO_DIR = os.path.abspath(os.path.expanduser(TO_DIR))
|
TO_DIR = os.path.abspath(os.path.expanduser(TO_DIR))
|
||||||
|
|
||||||
if not os.path.isdir(TO_DIR):
|
if not os.path.isdir(TO_DIR):
|
||||||
print "TO_DIR %s is not a directory!" % TO_DIR
|
print "TO_DIR %s is not a directory!" % TO_DIR
|
||||||
print usage()
|
print usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if ACTION == 'link':
|
if ACTION == 'link':
|
||||||
link(FROM_DIR,TO_DIR)
|
link(FROM_DIR,TO_DIR)
|
||||||
|
elif ACTION == 'tidy':
|
||||||
|
tidy(FROM_DIR)
|
||||||
elif ACTION == 'report':
|
elif ACTION == 'report':
|
||||||
link(FROM_DIR,TO_DIR,report=True)
|
link(FROM_DIR,TO_DIR,report=True)
|
||||||
tidy(FROM_DIR,report=True)
|
tidy(FROM_DIR,report=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user