本文整理汇总了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);
});
}