Skip to content

Commit 6fc1748

Browse files
committed
Support run env.py on windows system.
1 parent a6ceb5b commit 6fc1748

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

cmds/cmd_package.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,23 @@
2929
import pkgsdb
3030
import shutil
3131
import platform
32-
import requests
3332
import subprocess
3433
import time
3534
import logging
3635
import sys
3736

37+
try:
38+
import requests
39+
except ImportError:
40+
print("****************************************\n"
41+
"* Import requests module error.\n"
42+
"* Please install requests module first.\n"
43+
"* pip install step:\n"
44+
"* $ pip install requests\n"
45+
"* command install step:\n"
46+
"* $ sudo apt-get install python-requests\n"
47+
"****************************************\n")
48+
3849
from package import Package, Bridge_SConscript, Kconfig_file, Package_json_file, Sconscript_file
3950
from vars import Import, Export
4051
from string import Template

env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def main():
5555
if env_root == None:
5656
if platform.system() != 'Windows':
5757
env_root = os.path.join(os.getenv('HOME'), '.env')
58+
else:
59+
env_root = os.path.join(os.getenv('USERPROFILE'), '.env')
5860

5961
sys.path = sys.path + [os.path.join(script_root)]
6062

0 commit comments

Comments
 (0)