function help(status) { const print = (status === 0) ? console.log : console.error print("usage: " + basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]") print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]") process.exit(status) }
private _isCanvasDirectory(): boolean { return basename(this.directoryPath).startsWith('_'); }
function() { var result = basename(ui.otherPath, '.js'); return result + (result == buildName ? ' (2)' : ''); }()
private async _getInfo(): Promise<void> { this.infoYml = {}; // if there's an info.yml const ymlPath: string = join(this.directoryPath, 'info.yml'); const fileExists: boolean = await Utils.fileExists(ymlPath); if (fileExists) { this.infoYml = await Utils.readYml(ymlPath); console.log(chalk.green('got metadata for: ') + this.directoryPath); } else { console.log(chalk.green('no metadata found for: ') + this.directoryPath); } if (!this.infoYml.label) { // default to the directory name this.infoYml.label = basename(this.directoryPath); } }
export function processFile(__path, resultCallback, removeCallback = (hash) => {}, isFromLoader = false){ const hash = crypto.createHash("sha256") let data = Buffer.alloc(0) createReadStream(__path).on("data", chunk => { data = Buffer.concat([data, chunk]) hash.update(chunk) }).on("end", () => { const hashResult = hash.digest("hex") hashToUrl[hashResult] = __path if(isFromLoader && addonCache[hashResult]){ let value = addonCache[hashResult] if(value.timestamp < (Date.now() - 6.048e+8)){ delete addonCache[hashResult] contentManager.saveAddonCache() }else{ resultCallback(value.result) return } } checkHash(hashResult, data, basename(__path), resultCallback, removeCallback) }) }
const fileName: string = basename(file); const id: string = urljoin(this.url.href, directoryName, fileName);
const name: string = basename(directory); const url: string = urljoin(this.url.href, name); const newDirectory: Directory = new Directory(directory, url, this.generateThumbs, undefined, this);
private async _getInfo(): Promise<void> { this.infoYml = {}; // if there's an info.yml const ymlPath: string = join(this.directoryPath, 'info.yml'); const fileExists: boolean = await Utils.fileExists(ymlPath); if (fileExists) { this.infoYml = await Utils.readYml(ymlPath); console.log(chalk.green('got metadata for: ') + this.directoryPath); } else { console.log(chalk.green('no metadata found for: ') + this.directoryPath); } if (!this.infoYml.label) { // default to the directory name this.infoYml.label = basename(this.directoryPath); } }