當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fs-extra.copy函數代碼示例

本文整理匯總了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'));
開發者ID:wavesplatform,項目名稱:WavesGUI,代碼行數:1,代碼來源:gulpfile.ts

示例2: copy

 cb2 => copy(resolve(pack.path, pack.sprite.file), join(dir, filename), cb2),
開發者ID:julianlam,項目名稱:nodebb-plugin-emoji,代碼行數:1,代碼來源:build.ts

示例3: basename

 electronFiles.forEach((path) => {
     const name = basename(path);
     forCopy.push(copy(path, join(targetPath, name)));
 });
開發者ID:wavesplatform,項目名稱:WavesGUI,代碼行數:4,代碼來源:gulpfile.ts

示例4: Promise

 return new Promise((resolve, reject) => {
   fsExtra.copy(target, path.resolve(destination), err => {
     if (err) return reject(err);
     resolve();
   });
 });
開發者ID:WinGood,項目名稱:platform,代碼行數:6,代碼來源:util.ts

示例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);
                    });
                }
開發者ID:wavesplatform,項目名稱:WavesGUI,代碼行數:41,代碼來源:gulpfile.ts


注:本文中的fs-extra.copy函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。