Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var path = require('path')
var rc = require('rc')
var optimist = require('optimist')
var toCC = require('to-camel-case')
var osenv = require('osenv')
var home = osenv.home()
var tmp = osenv.tmpdir()
module.exports = (function () {
// *** vvv Copied this stuff out of npmconf **********************
var uidOrPid = process.getuid ? process.getuid() : process.pid
if (home) process.env.HOME = home
else home = path.resolve(temp, "npm-" + uidOrPid)
var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm"
var cacheRoot = process.platform === "win32" && process.env.APPDATA || home
var cache = path.resolve(cacheRoot, cacheExtra)
// *** ^^^ Copied this stuff out of npmconf **********************
var config = rc('npmd', {
dbPath: path.join(process.env.HOME, '.npmd'),
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var defaults = require('./defaults');
var win = process.platform === 'win32';
var home = osenv.home();
function rc(name, cwd, argv) {
var argvConfig;
argv = argv || optimist.argv;
// Parse --config.foo=false
argvConfig = object.map(argv.config || {}, function (value) {
return value === 'false' ? false : value;
});
// If we have specified a cwd then use this as the base for getting config.
cwd = argvConfig.cwd ? argvConfig.cwd : cwd;
if (cwd) {
return object.deepMixIn.apply(null, [
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var defaults = require('./defaults');
var win = process.platform === 'win32';
var home = osenv.home();
function rc(name, cwd, argv) {
var argvConfig;
argv = argv || optimist.argv;
// Parse --config.foo=false
argvConfig = object.map(argv.config || {}, function(value) {
return value === 'false' ? false : value;
});
// If we have specified a cwd then use this as the base for getting config.
cwd = argvConfig.cwd ? argvConfig.cwd : cwd;
if (cwd) {
return object.deepMixIn.apply(null, [
static setResolveLoaderPath(runtime) {
const jbRuntime = runtime || 'runtime-now-6';
const resolveLoaderPath = path.join(osenv.home(), './.feflow/node_modules');
// Loader在捷豹平台的查找路径
const jbLoaderPath = `/data/frontend/install/AlloyDist/${jbRuntime}/node_modules`;
return {
modules: [
path.resolve(__dirname, "../node_modules"),
resolveLoaderPath,
jbLoaderPath,
]
};
}
}
function getUsersHomeFolder() {
return osenv.home();
}
'use strict';
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var win = process.platform === 'win32';
var home = osenv.home();
function parse(content, file) {
var error;
if (!content.trim().length) {
return {};
}
try {
return JSON.parse(content);
} catch (e) {
if (file) {
error = new Error('Unable to parse ' + file + ': ' + e.message);
} else {
error = new Error('Unable to parse rc config: ' + e.message);
}
MpdConf.prototype.setDefaultState = function(){
this.state = {};
this.state.audio_httpd = {
format: 'ogg',
quality: 6,
port: 16243
};
this.state.audio_pulse = null;
this.state.audio_alsa = null;
this.state.audio_oss = null;
this.state.run_dir = null;
this.state.music_directory = path.join(osenv.home(), 'music');
};
this.When(/^I double click on the "([^"]*)" folder$/, function (folderName, callback) {
var folderPath = path.join(osenv.home(),folderName);
this.app.client.doubleClick(`//img[@data-filepath="${folderPath}"]`)
.then(() => { callback(); });
});
private getUserFilePath(): string {
return join(this.$hostInfo.isWindows ? join(process.env.AppData) :
this.$hostInfo.isDarwin ? join(home(), "Library", "Application Support") : join(home(), ".config"),
"KinveyStudio",
"kinveyUser.json");
}
}