mirror of https://github.com/Jittor/Jittor
fix cd
This commit is contained in:
parent
a112d0fb86
commit
195f754cba
|
@ -190,7 +190,7 @@ def install_cutt(root_folder):
|
|||
|
||||
from jittor_utils import run_cmd
|
||||
LOG.i("installing cutt...")
|
||||
run_cmd(f"cd {dirname} && make")
|
||||
run_cmd(f"make", cwd=dirname)
|
||||
return dirname
|
||||
|
||||
def setup_cutt():
|
||||
|
|
|
@ -103,8 +103,10 @@ def try_import_jit_utils_core(silent=None):
|
|||
|
||||
def run_cmd(cmd, cwd=None, err_msg=None, print_error=True):
|
||||
LOG.v(f"Run cmd: {cmd}")
|
||||
if cwd: cmd = f"cd {cwd} && {cmd}"
|
||||
r = sp.run(cmd, shell=True, stdout=sp.PIPE, stderr=sp.STDOUT)
|
||||
if cwd:
|
||||
r = sp.run(cmd, cwd=cwd, shell=True, stdout=sp.PIPE, stderr=sp.STDOUT)
|
||||
else:
|
||||
r = sp.run(cmd, shell=True, stdout=sp.PIPE, stderr=sp.STDOUT)
|
||||
s = r.stdout.decode('utf8')
|
||||
if r.returncode != 0:
|
||||
if print_error:
|
||||
|
|
|
@ -44,7 +44,7 @@ jit_op_entry_t load_jit_lib(string name, string symbol_name="jit_entry") {
|
|||
}
|
||||
|
||||
void run_cmd(string cmd, string cwd="") {
|
||||
if (cwd.size()) cmd = "cd "+cwd + " && " + cmd;
|
||||
if (cwd.size()) cmd = "cd '"+cwd + "' && " + cmd;
|
||||
LOGvvv << "Run cmd:" << cmd;
|
||||
system_with_check(cmd.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue