diff --git a/lib/conf.js b/lib/conf.js index fa47356..79be446 100644 --- a/lib/conf.js +++ b/lib/conf.js @@ -11,8 +11,14 @@ var os = require('os') , filename = process.argv[1] ; -const {username = 'seeli'} = os.userInfo() -const host = os.hostname() +let username = 'seeli' +let host = 'local' +try { + const info = os.userInfo() + host = os.hostname() + username = info.username +} catch (_) {} + const PS1 = `${username}@${host}` const name = filename ? path.basename(filename, '.js') : 'seeli'