location (depth) { depth = depth || 0; let loc = process.cwd(); let pathnames = loc.split(path.sep); // If Window directory drive, don't add starting "/" let fullpath = pathnames[0].indexOf(':') > -1 ? path.join.apply(path, pathnames.slice(0, pathnames.length - depth)) : path.join.apply(path, ['/'].concat(pathnames.slice(0, pathnames.length - depth))); return this.workspace() && depth <= pathnames.length && fullpath.toLowerCase() === this.workspace().toLowerCase(); }
function writeFile(directory, pathname, buffer, dirs) { pathname = path.join.apply(path, [].concat(directory.split('/'), pathname.split('/'))); let paths = pathname.split(path.sep); for (let i = 1; i < paths.length; i++) { let dirpath = path.join.apply(path, [process.cwd()].concat(paths.slice(0, i))); if (!dirs[dirpath]) { !fs.existsSync(dirpath) && fs.mkdirSync(dirpath); dirs[dirpath] = true; } } fs.writeFileSync(path.join(process.cwd(), pathname), buffer, {mode: 0o777}); return dirs; }
let relpath = path.join.apply(path, [fPath].concat(directories.slice(0, i + 1))); !fs.existsSync(relpath) && fs.mkdirSync(relpath); functionPath = relpath;
// ------------------------------------ // Utilities // ------------------------------------ function base () { const args = [config.path_base].concat([].slice.call(arguments)) return path.resolve.apply(path, args) }
function cwd() { var args = [] var len = arguments.length while (len--) args[len] = arguments[len] return path.resolve.apply(void 0, [process.cwd()].concat(args)) }
(() => { const base = [config.get('path_project')]; const resolve = path.resolve; const project = (...args) => resolve.apply(resolve, [...base, ...args]); return { project, src: project.bind(null, config.get('dir_src')), build: project.bind(null, config.get('dir_build')), public: project.bind(null, config.get('dir_public')), }; })()
/** * Get container name. * @param {String...} arguments name parts * @return {String} Container name */ var getContainerName = function () { return path.normalize(path.join.apply(null, arguments)) }
var mkdirpSync = function (dirpath) { var parts = dirpath.split(path.sep); for( var i = 1; i <= parts.length; i++ ) { mkdirSync( path.join.apply(null, parts.slice(0, i)) ); } }
function contentPath (cache, integrity) { const sri = ssri.parse(integrity, { single: true }) // contentPath is the *strongest* algo given return path.join.apply(path, [ contentDir(cache), sri.algorithm ].concat(hashToSegments(sri.hexDigest()))) }
function bucketPath (cache, key) { const hashed = hashKey(key) return path.join.apply(path, [bucketDir(cache)].concat( hashToSegments(hashed) )) }
// ------------------------------------ // Utilities // ------------------------------------ function base () { const args = [config.path_base].concat([].slice.call(arguments)) return path.resolve.apply(path, args) }
function cwd() { var args = [] var len = arguments.length while (len--) args[len] = arguments[len] return path.resolve.apply(void 0, [process.cwd()].concat(args)) }
// ------------------------------------ // Utilities // ------------------------------------ function base () { const args = [config.path_base].concat([].slice.call(arguments)) return path.resolve.apply(path, args) }
// ------------------------------------ // Utilities // ------------------------------------ function base () { const args = [config.path_base].concat([].slice.call(arguments)) return path.resolve.apply(path, args) }
/** * Get container name. * @param {String...} arguments name parts * @return {String} Container name */ const getContainerName = function () { return path.normalize(path.join.apply(null, arguments)) }