mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(socket) add HOME
This commit is contained in:
parent
5d3a4715f1
commit
042e0ba70c
1 changed files with 3 additions and 3 deletions
|
|
@ -16,6 +16,7 @@
|
|||
ClientFuncs = [],
|
||||
OnMessageFuncs = [],
|
||||
INFO_LOG_LEVEL = 2,
|
||||
HOME = process.env.HOME,
|
||||
WIN32 = main.WIN32,
|
||||
HELP = {
|
||||
stdout : CLOUDCMD + ' exit \n' +
|
||||
|
|
@ -266,14 +267,13 @@
|
|||
}
|
||||
|
||||
function onCD(pCommand) {
|
||||
var lRet, lDir, lHome, lError,
|
||||
var lRet, lDir, lError,
|
||||
lMsg = '';
|
||||
|
||||
lDir = Util.removeStr(pCommand, 'cd ');
|
||||
lHome = process.env.HOME;
|
||||
|
||||
if (Util.isContainStr(lDir, '~'))
|
||||
lDir = Util.replaceStr(lDir, '~', lHome);
|
||||
lDir = Util.replaceStr(lDir, '~', HOME);
|
||||
|
||||
lError = Util.tryCatchLog(function() {
|
||||
process.chdir(lDir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue