Skip to content

Instantly share code, notes, and snippets.

@petebachant
Created July 29, 2017 10:59
Show Gist options
  • Select an option

  • Save petebachant/ae3dcd8bf413b4694c8cc521b20215c4 to your computer and use it in GitHub Desktop.

Select an option

Save petebachant/ae3dcd8bf413b4694c8cc521b20215c4 to your computer and use it in GitHub Desktop.
Custom script to call the Windows Atom executable from WSSL
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