Skip to content

Commit

Permalink
Transform script adjustments for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnmmeyer committed Mar 12, 2024
1 parent a9c3e99 commit 5e381e3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 64 deletions.
44 changes: 22 additions & 22 deletions stylesheets/convert.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/usr/bin/env python3

import os, sys, platform, tempfile, subprocess

system = platform.system()
if system == "Windows":
browser = "start"
elif system == "Darwin":
browser = "open"
else:
browser = "xdg-open"

if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} FILE", file=sys.stderr)
sys.exit(1)

input = sys.argv[1]
tmp_dir = tempfile.gettempdir()
output = os.path.join(tmp_dir, "dharma_output.html")

subprocess.run(["curl", "-s", "-F", f"file=@{input}", "-o", output, "https://dharmalekha.info/convert"], check=True)
subprocess.run([browser, output])
#!/usr/bin/env python3

import os, sys, platform, tempfile, subprocess

system = platform.system()
if system == "Windows":
browser, shell = "start", True
elif system == "Darwin":
browser, shell = "open", False
else:
browser, shell = "xdg-open", False

if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} FILE", file=sys.stderr)
sys.exit(1)

input = sys.argv[1]
tmp_dir = tempfile.gettempdir()
output = os.path.join(tmp_dir, "dharma_output.html")

subprocess.run(["curl", "-s", "-F", f"file=@{input}", "-o", output, "https://dharmalekha.info/convert"], check=True)
subprocess.run([browser, output], shell=shell)
42 changes: 0 additions & 42 deletions stylesheets/convert.sh

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5e381e3

Please sign in to comment.