function copyPublicFolder() { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }
function setupRepo() { return Promise .all(trashPaths.map(trash)) .then(() => { if (! isWin) { const safeCharactersPath = path.resolve(fixturePath, "safe-characters[#%&;=].mjs") const unsafeCharactersPath = path.resolve(fixturePath, "unsafe-characters[\b\t\n\r:?].mjs") if (! fs.existsSync(unsafeCharactersPath)) { fs.copySync(safeCharactersPath, unsafeCharactersPath) } } }) }
flow(function*() { const exportPath = yield ipcc.callMain('open-dialog'); if (exportPath) { self.projects.forEach(project => { project.readContents(true); project.allItems.forEach(item => { if (item.name.includes('.env') || item.name.includes('public-key')) { try { let from = item.path; let to = path.join(exportPath, project.name, item.name); fsExtra.copySync(from, to); } catch (err) { console.error(err); } } }); }); toast({ title: `Exported all .env files to ${exportPath}` }); } })
} else { fileTool.copySync('./static_temp', './dist/static/files'); rmDirFiles('./static_temp'); img = path.join(urlPath, filename);
flow(function*() { const importPath = yield ipcc.callMain('open-dialog'); if (importPath) { let entries = fs.readdirSync(importPath); entries.filter(entry => { let folderPath = path.join(importPath, entry); let isFolder = fs.lstatSync(folderPath).isDirectory(); if (isFolder) { const envFiles = fs.readdirSync(folderPath); envFiles.forEach(file => { const foundProject = self.projects.find(p => p.name === entry); if (foundProject) { const filePath = path.join(folderPath, file); const to = path.join(foundProject.path, file); fsExtra.copySync(filePath, to); } }); } }); toast({ title: `Imported all .env files to ${importPath}` }); } })
setTimeout(() => { console.log('cloning', project, projectInfo); const store = getRoot(self); const newPath = path.join(store.settings.projectsPath, projectInfo.name); console.log('newPath', newPath); const files = fs.readdirSync(project.path); files.forEach(file => { let restrictedFiles = ['node_modules', 'build', 'dist', '.idea', '.vscode', '.git']; let isRestricted = restrictedFiles.includes(file); if (!isRestricted) { const fromFile = path.join(project.path, file); const toFile = path.join(newPath, file); fsExtra.copySync(fromFile, toFile); } }); const newProject = Project.create({ name: projectInfo.name, path: newPath }); self.addNewProject(newProject); setTimeout(() => { toast({ title: `Successfully cloned project!`, type: 'success' }); }, 1000); }, 500);
} else { fileTool.copySync('./static_temp', './dist/static/files'); rmDirFiles('./static_temp'); img = path.join(urlPath, filename);
function syncDirOrFile(assert, srcRootPath, destRootPath) { const srcPath = path.join(srcRootPath, assert.path) const destPath = path.join(destRootPath, assert.path) if ( (assert.type === 'file' && !isExist(destPath, assert.type)) || (assert.type === 'dir' && !isExist(destPath, assert.type)) || assert.action === 'force' ) { console.log(' ' + chalk.cyan(assert.path)) fs.copySync(srcPath, destPath) } }
output.on('close', () => { global.console.log(`mirror.zip [${archive.pointer()} bytes]`) removeSync(dir('temp')) copySync(dir('CNAME'), dir('docs', 'CNAME')) })
const copyPublicFolder = () => { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }
function copyPublicFolder() { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }
function copyPublicFolder() { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }
function copyPublicFolder() { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }
function copyPublicFolder() { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }
function copyPublicFolder() { fs.copySync(paths.appPublic, paths.appBuild, { dereference: true, filter: file => file !== paths.appHtml, }); }