-
-
Save petebachant/ae3dcd8bf413b4694c8cc521b20215c4 to your computer and use it in GitHub Desktop.
Custom script to call the Windows Atom executable from WSSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import os | |
| import sys | |
| try: | |
| args = sys.argv[1:] | |
| except IndexError: | |
| args = [] | |
| atom_exe = "cmd.exe /mnt/c/Users/peteb/AppData/Local/atom/bin/atom.cmd" | |
| # If any arguments are directories, convert paths to Windows | |
| ubuntu_root = "C:/Users/peteb/AppData/Local/Packages/CanonicalGroupLimited.Ubunt | |
| uonWindows_79rhkp1fndgsc/LocalState/rootfs" | |
| for n, arg in enumerate(args): | |
| if os.path.isdir(arg): | |
| abspath = os.path.abspath(arg) | |
| args[n] = ubuntu_root + abspath | |
| cmd = atom_exe + " " + " ".join(args) | |
| subprocess.call(cmd, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment