Created
January 10, 2018 16:57
-
-
Save ntrepid8/e62759b6fde57bc4de1efb373669948c to your computer and use it in GitHub Desktop.
Revisions
-
ntrepid8 created this gist
Jan 10, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/env python3 import os import subprocess cwd = os.getcwd() file_list = [f for f in os.listdir(cwd) if f.endswith('.sublime-project')] fl_len = len(file_list) if fl_len == 0: print("sublime-project file not found") elif fl_len == 1: print("opening: {}".format(file_list[0])) subprocess.run(["/usr/bin/subl", "--project", file_list[0]]) else: print("error: multiple sublime-project files found")