static driverDependencies(dbType) { if (DriverDependencies[dbType]) { return DriverDependencies[dbType]; } else if (fs.existsSync(path.join('node_modules', `${dbType}-cubejs-driver`))) { return `${dbType}-cubejs-driver`; } throw new Error(`Unsupported db type: ${dbType}`); }
function copyBundle() { const srcPath = path.resolve(buildPath, "esm.js") return fs.existsSync(srcPath) ? fs.copy(srcPath, loaderPath) : Promise.resolve() }
function Handle(electron) { global.pathEnv=path.join(electron.app.getPath("home"),"DOClever-Desktop"); if(!fs.existsSync(global.pathEnv)) { fs.mkdirSync(global.pathEnv); } this.update=new update(electron); this.plugin=new plugin(electron); this.cookie=new cookie(electron); this.member=new member(electron); this.request=require("request"); this.fs=require("fs-extra") }
/*#__PURE__*/ function () { var _ref = _asyncToGenerator(function* (config) { const cwd = config.cwd, templates = config.templates; const resolvedTemplates = [process.env.HYGEN_TMPLS, _path.default.join(cwd, '_templates')].find(_ => _ && fs.existsSync(_)) || templates; return _objectSpread({}, config, { templates: resolvedTemplates }, (yield configResolver.resolve(cwd))); }); return function (_x) { return _ref.apply(this, arguments); }; }()
function setupAcorn() { if (fs.existsSync(acornPath)) { return Promise.resolve() } return download(acornURL, acornPath, { extract: true, filter: (file) => extractFilterRegExp.test(file.path), strip: 1 }) }
function setupRepo() { return Promise .all(trashPaths.map(trash)) .then(() => { if (! isWin) { const safeCharactersPath = path.resolve(fixturePath, "safe-characters[#%&;=].mjs") const unsafeCharactersPath = path.resolve(fixturePath, "unsafe-characters[\b\t\n\r:?].mjs") if (! fs.existsSync(unsafeCharactersPath)) { fs.copySync(safeCharactersPath, unsafeCharactersPath) } } }) }
findDocusaurus2Root(outputDirectory: string) { const docsName = 'docs'; function splitPath(dir: string) { const parts = dir.split(/(\/|\\)/); if (!parts.length) { return parts; } return !parts[0].length ? parts.slice(1) : parts; } function testDir(parts) { if (parts.length === 0) { return null; } const p = parts.join(''); const itdoes = fs.existsSync(path.join(p, docsName)); return itdoes ? p : testDir(parts.slice(0, -1)); } return testDir(splitPath(outputDirectory)); }
projects.forEach(({ name, docsPath, outputDir }) => { const tmpDir = path.join(outputDir, 'tmp'); const project = app.convert(app.expandInputFiles([docsPath])); if (project) { app.generateDocs(project, tmpDir); if (fs.existsSync(tmpDir)) { const [tmpFileName] = fs.readdirSync(tmpDir); const pathArr = tmpDir.split('/'); pathArr.splice(-1, 1); const out = path.join(...pathArr); const currentPath = path.join(out, `${name}.md`); fs.copyFileSync(path.join(tmpDir, tmpFileName), currentPath); fs.removeSync(tmpDir); } } else { console.error(`Error while generating '${name}' docs`); } });
function setReadmeContent(content) { if (!fs.existsSync(readmePath)) throw new Error(`Cannot find ${readmePath}`); return fs.writeFileSync(readmePath, content); }
/*#__PURE__*/ function () { var _ref = _asyncToGenerator(function* (config) { const cwd = config.cwd, templates = config.templates; const start = new Date(); const fileConfig = yield resolver.resolve(cwd); console.log('timing:', new Date() - start); const resolvedTemplates = L.find([// $FlowFixMe process.env.HYGEN_TMPLS, path.join(cwd, '_templates')], _ => fs.existsSync(_)) || templates; return _extends({}, config, { templates: resolvedTemplates }, fileConfig); }); return function (_x) { return _ref.apply(this, arguments); }; }()
function readmeContent() { if (!fs.existsSync(readmePath)) throw new Error(`Cannot find ${readmePath}`); return fs.readFileSync(readmePath, 'utf8'); }
function executablePath(file) { const potentialPaths = [ '/usr/local/opt/gettext/bin/', '/opt/local/bin/', '/usr/local/bin/', ]; for (const path of potentialPaths) { const pathFile = path + file; if (fs.existsSync(pathFile)) { return pathFile; } } throw new Error(`${file} could not be found. Please install via brew or MacPorts.\n`); }
function Handle(electron) { global.pathEnv=path.join(electron.app.getPath("home"),"DOClever-Desktop"); if(!fs.existsSync(global.pathEnv)) { fs.mkdirSync(global.pathEnv); } this.update=new update(electron); this.plugin=new plugin(electron); this.cookie=new cookie(electron); this.member=new member(electron); this.request=require("request"); this.fs=require("fs-extra") }
function Handle(electron) { global.pathEnv=path.join(electron.app.getPath("home"),"DOClever-Desktop"); if(!fs.existsSync(global.pathEnv)) { fs.mkdirSync(global.pathEnv); } this.update=new update(electron); this.plugin=new plugin(electron); this.cookie=new cookie(electron); this.member=new member(electron); this.request=require("request"); this.fs=require("fs-extra") }
findDocusaurusRoot(outputDirectory: string) { const docsName = 'docs'; function splitPath(dir: string) { const parts = dir.split(/(\/|\\)/); if (!parts.length) { return parts; } return !parts[0].length ? parts.slice(1) : parts; } function testDir(parts) { if (parts.length === 0) { return null; } const p = parts.join(''); const itdoes = fs.existsSync(path.join(p, docsName)); return itdoes ? p : testDir(parts.slice(0, -1)); } return testDir(splitPath(outputDirectory)); }