/** * Factory the complete file path * * @param {String} templatesPath - Templates dir path * @param {String} filename - file name without extension * * @return {String} complete file path */ const factoryFilePath = (templatesPath, filename) => `${path.join(templatesPath, filename)}.html`
fetchContext: () => Promise.resolve({}), fetchTemplate: fetchTemplate( templatesPath || path.join(process.cwd(), 'templates') ), fragmentTag: 'fragment',
describe('fetch-template', () => { let mockParseTemplate; const mockRequest = { url: 'http://localhost:8080/test' }; const templatePath = path.join(__dirname); const baseTemplatePath = path.join(templatePath, 'base-template.html'); const testTemplatePath = path.join(templatePath, 'test.html'); const wrongTemplatePath = path.join( templatePath, 'wrong-template.html'
allMacOS() { let directories = []; this.checkForStudio('/Applications').forEach(name => { directories.push(`/Applications/${name}`); }); this.checkForStudio(path.join(platform_1.homedir, 'Applications')).forEach(name => { directories.push(path.join(platform_1.homedir, 'Applications', name)); }); return directories.map(path => this.fromMacOSBundle(path)); }
public getBuildToolsPath(binaryName: string) { if (!this.buildToolsVersionName) { return '' } return path.join(this.sdk.directory, 'build-tools', this.buildToolsVersionName, binaryName) }
test('MBTiles -- metadata', t => { for (const filename of fixtures) { const name = path.parse(filename).name const db = new MBTiles(directories.in + filename) db.metadata().then(metadata => { const output = path.join(directories.out, `metadata-${name}.json`) if (process.env.REGEN) write.sync(output, metadata) t.deepEqual(metadata, load.sync(output), filename) }).catch(error => console.error(error)) } t.end() })
plop.setActionType('prettify', (answers, config) => { const folderPath = `${path.join( __dirname, '/../../app/', config.path, plop.getHelper('properCase')(answers.name), '**.js', )}`; exec(`npm run prettify -- "${folderPath}"`); return folderPath; });
public validSdkDirectory(dir) { const dirPath = path.join(dir, 'platform-tools') if (fs.existsSync(dirPath)) { return fs.statSync(dirPath).isDirectory() } return false }
fromMacOSBundle(bundlePath) { const studioPath = path.join(bundlePath, 'Contents'); const plistFile = path.join(studioPath, 'Info.plist'); const versionString = this.iosWorkflow.getPlistValueFromFile(plistFile, plist_utils_1.kCFBundleShortVersionStringKey); let version; if (versionString) { version = version_1.versionParse(versionString); } return new AndroidStudioValid(studioPath, { version: version }); }
public allMacOS(): AndroidStudioValid[] { let directories = [] this.checkForStudio('/Applications').forEach(name => { directories.push(`/Applications/${name}`) }) this.checkForStudio(path.join(homedir, 'Applications')).forEach(name => { directories.push(path.join(homedir, 'Applications', name)) }) return directories.map(path => this.fromMacOSBundle(path)) }
public fromMacOSBundle(bundlePath: string): AndroidStudioValid { const studioPath = path.join(bundlePath, 'Contents') const plistFile: any = path.join(studioPath, 'Info.plist') const versionString = this.iosWorkflow.getPlistValueFromFile(plistFile, kCFBundleShortVersionStringKey) let version: VersionOption if (versionString) { version = versionParse(versionString) } return new AndroidStudioValid(studioPath, { version: version }) }
validSdkDirectory(dir) { const dirPath = path.join(dir, 'platform-tools'); if (fs.existsSync(dirPath)) { return fs.statSync(dirPath).isDirectory(); } return false; }
getBuildToolsPath(binaryName) { if (!this.buildToolsVersionName) { return ''; } return path.join(this.sdk.directory, 'build-tools', this.buildToolsVersionName, binaryName); }