Skip to content

Commit

Permalink
Add imgdogcat.py : add executable path
Browse files Browse the repository at this point in the history
  • Loading branch information
cozy-hn committed Mar 24, 2024
1 parent 65d60f1 commit 5bc76a9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions imgdogcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
parser.add_argument('-g', '--gif', action='store_true', help='Fetch a random gif image.')
args = parser.parse_args()

script_directory = os.path.dirname(os.path.realpath(__file__))
if getattr(sys, 'frozen', False):
script_directory = os.path.dirname(sys.executable)
else:
script_directory = os.path.dirname(os.path.abspath(__file__))

imgcat_path = os.path.join(script_directory, 'imgcat.sh')
print(imgcat_path)


if args.gif:
# tags = ["new+jeans", "twice", "ive", "black+pink", "red+velvet", "itzy", "aespa", "LE+SSERAFIM"]
Expand Down Expand Up @@ -82,5 +86,5 @@


run(["echo"])
run([imgcat_path, tmp_file_name])
run([imgcat_path, "-W", "40%", tmp_file_name])
os.remove(tmp_file_name)

0 comments on commit 5bc76a9

Please sign in to comment.