Update index.py

pull/109/head
midoks 6 years ago
parent 3a81e3392b
commit 2a324704d2
  1. 19
      plugins/pm2/index.py

@ -64,28 +64,29 @@ def status():
return 'start' return 'start'
def pm2NVMDir(): def rootDir():
path = '/root/.nvm' path = '/root'
if public.isAppleSystem(): if public.isAppleSystem():
user = public.execShell( user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip() "who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
path = '/Users/' + user + '/.nvm' path = '/Users/' + user
return path
def pm2NVMDir():
path = rootDir() + '/.nvm'
return path return path
__SR = '''#!/bin/bash __SR = '''#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH export PATH
export HOME=%s export HOME=%s
source %s/nvm.sh && ''' % (getServerDir(), pm2NVMDir()) source %s/nvm.sh && ''' % (rootDir(), pm2NVMDir())
__path = getServerDir() + '/list' __path = getServerDir() + '/list'
def pm2LogDir(): def pm2LogDir():
path = '/root/.pm2' path = rootDir() + '/.pm2'
if public.isAppleSystem():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
path = '/Users/' + user + '/.pm2'
return path return path

Loading…
Cancel
Save