Skip to content

Commit

Permalink
"install": Do a little refactorin'.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Apr 21, 2024
1 parent b1802df commit 9fd3cf2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ if __name__ == "__main__":

if os.path.exists(destination):
if os.path.samefile(destination.resolve(), source):
print('[] Link to "' + str(source) + '" already exists')
print('[-] Link to "{}" already exists'.format(source))
else:
print('[✘] "' + str(destination) + '" already exists')
print('[✘] "{}" already exists'.format(destination))
errors = True
else:
if os.path.islink(destination):
print('[✘] "' + str(destination) + '" is a dangling symlink')
print('[✘] "{}" is a dangling symlink'.format(destination))
errors = True
else:
if "/" in file:
os.makedirs(os.path.dirname(destination), 0o700, True)

os.symlink(source, destination)
print('[✔] Created link to "' + str(source) + '"')
print('[✔] Created link to "{}"'.format(source))

for tag in vim_tags:
tag_checksum = None
Expand All @@ -89,11 +89,11 @@ if __name__ == "__main__":
)

if tag_checksum == hashlib.sha256(tag_file.read_bytes()).digest():
print('[-] "{}" is already up-to-date'.format(str(tag_file)))
print('[-] "{}" is already up-to-date'.format(tag_file))
else:
print('[✔] Generated "{}"'.format(str(tag_file)))
print('[✔] Generated "{}"'.format(tag_file))
except subprocess.CalledProcessError as e:
print('[✘] Unable to generate "{}"'.format(str(tag_file)))
print('[✘] Unable to generate "{}"'.format(tag_file))
print(textwrap.indent(e.output.decode().strip(), " "))

errors = True
Expand Down

0 comments on commit 9fd3cf2

Please sign in to comment.