本文整理匯總了TypeScript中fs-extra.copy函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript copy函數的具體用法?TypeScript copy怎麽用?TypeScript copy使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了copy函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: copy
const copyI18next = () => copy(join(__dirname, 'node_modules', 'i18next', 'dist'), join(root, 'i18next'));
示例2: copy
cb2 => copy(resolve(pack.path, pack.sprite.file), join(dir, filename), cb2),
示例3: basename
electronFiles.forEach((path) => {
const name = basename(path);
forCopy.push(copy(path, join(targetPath, name)));
});
示例4: Promise
return new Promise((resolve, reject) => {
fsExtra.copy(target, path.resolve(destination), err => {
if (err) return reject(err);
resolve();
});
});
示例5: task
task(`copy-${taskPostfix}`, copyDeps, function (done) {
const reg = new RegExp(`(.*?\\${sep}src)`);
let forCopy = JSON_LIST.map((path) => {
return copy(path, path.replace(reg, `${targetPath}`));
}).concat(
copy(join(__dirname, 'src/fonts'), `${targetPath}/fonts`),
meta.exportPageVendors.map(p => copy(join(__dirname, p), join(targetPath, p)))
);
forCopy.push(copy(join('dist', 'locale'), join(targetPath, 'locales')));
forCopy.push(copy(join(__dirname, 'tradingview-style'), join(targetPath, 'tradingview-style')));
if (buildName === 'desktop') {
const electronFiles = getFilesFrom(join(__dirname, 'electron'), '.js');
electronFiles.forEach((path) => {
const name = basename(path);
forCopy.push(copy(path, join(targetPath, name)));
});
forCopy.push(copy(join(__dirname, 'electron', 'icons'), join(targetPath, 'img', 'icon.png')));
forCopy.push(copy(join(__dirname, 'electron', 'waves.desktop'), join(targetPath, 'waves.desktop')));
forCopy.push(copy(join(__dirname, 'node_modules', 'i18next', 'dist'), join(targetPath, 'i18next')));
}
Promise.all([
Promise.all(meta.copyNodeModules.map((path) => {
return copy(join(__dirname, path), join(targetPath, path));
})) as Promise<any>,
copy(join(__dirname, 'src/img'), `${targetPath}/img`).then(() => {
const images = IMAGE_LIST.map((path) => path.replace(reg, ''));
return writeFile(join(targetPath, 'img', 'images-list.json'), JSON.stringify(images));
}),
copy(tmpCssPath, join(targetPath, 'css')),
copy('LICENSE', join(`${targetPath}`, 'LICENSE')),
copy('googleAnalytics.js', join(`${targetPath}`, 'googleAnalytics.js')),
copy('amplitude.js', join(`${targetPath}`, 'amplitude.js')),
].concat(forCopy)).then(() => {
done();
}, (e) => {
done(e);
});
}