mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-10 15:39:01 +00:00
add support for running from an external drive on wsl
This commit is contained in:
parent
0f3686d21a
commit
3a8babb546
@ -28,13 +28,16 @@ print(f'{bold}=== NOTION ENHANCER CUSTOMISATION LOG ==={normal}\n')
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
filepath = ''
|
filepath = ''
|
||||||
__folder__ = os.path.dirname(os.path.abspath(__file__)).replace('\\', '/')
|
__folder__ = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/')
|
||||||
|
print(__folder__)
|
||||||
if 'microsoft' in platform.uname()[3].lower() and sys.platform == 'linux':
|
if 'microsoft' in platform.uname()[3].lower() and sys.platform == 'linux':
|
||||||
filepath = '/mnt/c/' + \
|
filepath = '/mnt/c/' + \
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
['cmd.exe', '/c', 'echo', '%localappdata%'], stdout=subprocess.PIPE).stdout \
|
['cmd.exe', '/c', 'echo', '%localappdata%'], stdout=subprocess.PIPE).stdout \
|
||||||
.rstrip().decode('utf-8')[3:].replace('\\', '/') + '/Programs/Notion/resources'
|
.rstrip().decode('utf-8')[3:].replace('\\', '/') + '/Programs/Notion/resources'
|
||||||
__folder__ = 'C:/' + __folder__[6:]
|
drive = __folder__[5].capitalize() if __folder__.startswith(
|
||||||
|
'/mnt/') else 'C'
|
||||||
|
__folder__ = drive + ':/' + __folder__[6:]
|
||||||
elif sys.platform == 'win32':
|
elif sys.platform == 'win32':
|
||||||
filepath = subprocess.run(['echo', '%localappdata%'], shell=True, capture_output=True).stdout \
|
filepath = subprocess.run(['echo', '%localappdata%'], shell=True, capture_output=True).stdout \
|
||||||
.rstrip().decode('utf-8').replace('\\', '/') + '/Programs/Notion/resources'
|
.rstrip().decode('utf-8').replace('\\', '/') + '/Programs/Notion/resources'
|
||||||
|
Loading…
Reference in New Issue
Block a user