Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => {
copySync('README.md', join(process.cwd(), 'dist/README.md'));
})
.then(() => console.log('success'));
//npm --prefix requires package.json to be in the location given
fs.copySync('package.json', path.resolve(dir, './package.json'));
//now npm has the package-lock
if(fs.existsSync('package-lock.json')) {
fs.copySync('package-lock.json', path.resolve(dir, './package-lock.json'));
}
//Shrinkwrap is important, we don't want to silently skip it
if (fs.existsSync('npm-shrinkwrap.json')) {
fs.copySync('npm-shrinkwrap.json', path.resolve(dir, './npm-shrinkwrap.json'));
}
//but shrinkwrap is uncomfortable for daily development, so you can store it in a file that only this bundler will use.
//TODO: make this configurable with commandline argument
if (fs.existsSync('npm-shrinkwrap-production.json')) {
fs.copySync('npm-shrinkwrap-production.json', path.resolve(dir, './npm-shrinkwrap.json'));
}
//shrinkwrap is old news, package-lock has to be there too!
if (fs.existsSync('package-lock.json')) {
fs.copySync('package-lock.json', path.resolve(dir, './package-lock.json'));
}
//support audit resolutions
if (fs.existsSync('audit-resolv.json')) {
fs.copySync('audit-resolv.json', path.resolve(dir, './audit-resolv.json'));
}
const tarball = path.resolve(process.cwd(), common.getTarballName(dir))
//Get rid of the previous tarball, because I'm afraid tar could merge instead of overwriting
fs.removeSync(tarball)
//The main purpose of this is to reject the promise based on exit code
function promiseCommand(command) {
const opts = {
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml
});
}
function createGitIgnore(appPath: string, ownPath: string) {
const dotIgnorePath = path.join(appPath, '.gitignore')
const ignorePath = path.join(appPath, 'gitignore')
if (fs.existsSync(dotIgnorePath)) {
return
}
if (fs.existsSync(ignorePath)) {
fs.moveSync(ignorePath, dotIgnorePath)
return
}
const defaultIgnorePath = path.join(ownPath, 'lib/gitignore')
fs.copySync(defaultIgnorePath, dotIgnorePath)
message.info('created .gitignore')
}
module.exports = function (done) {
fs.removeSync('./build');
fs.mkdirsSync('build');
fs.copySync('./static/.', './build/');
fs.copySync('./node_modules/webmaker-app-icons/fonts/.', './build/fonts');
done();
};
function copyAssets(appRoot, assetDirs) {
for (const { dir, name } of assetDirs) {
for (const folder of ['private', 'public']) {
const sourceDir = dir + '/' + folder;
const targetDir = path.join(appRoot, folder, 'plugins', name);
if (exists(sourceDir)) {
try {
fs.copySync(sourceDir, targetDir);
} catch (error) {
Log.error(`Can't copy files from ${sourceDir} to ${targetDir}: ${error.message}`);
}
}
}
}
}
function copyAssetsToTmpFolder( iconPath ) {
var tmpDir = os.tmpDir();
fs.copySync(
path.join( __dirname, '..', 'assets', 'win', 'nsProcess.nsh' ),
path.join( tmpDir, 'nsProcess.nsh' )
);
fs.copySync(
path.join( __dirname, '..', 'assets', 'win', 'FileAssociation.nsh' ),
path.join( tmpDir, 'FileAssociation.nsh' )
);
fs.copySync(
path.join( __dirname, '..', 'assets', 'win', 'nsProcess.dll' ),
path.join( tmpDir, 'nsProcess.dll' )
);
fs.copySync(
path.resolve( iconPath ),
path.join( tmpDir, 'icon.ico' )
);
}
function copyExample(srcDir, targetDir) {
let manifest = readJsonSync(join(srcDir, 'package.json'));
if ('title' in manifest) {
copySync(srcDir, targetDir, path => !path.includes('/node_modules'));
copySync('build/tabris', join(targetDir, 'node_modules/tabris'));
installDependencies(targetDir, manifest);
return {
category: manifest.category || '',
title: manifest.title,
description: manifest.description || '',
path: basename(srcDir)
};
}
}
function copyVisualTemplate(targetPath, templateName) {
fs.copySync(path.join(VISUAL_TEMPLATES_PATH, '_global'), targetPath);
fs.copySync(path.join(VISUAL_TEMPLATES_PATH, templateName), targetPath);
}
/**
beforeEach(async () => {
gopath = fs.realpathSync(lifecycle.temp.mkdirSync('gopath-'))
process.env.GOPATH = gopath
source = path.join(__dirname, '..', 'fixtures')
target = path.join(gopath, 'src', 'what')
fs.copySync(source, target)
atom.config.set('go-plus.guru.highlightIdentifiers', true)
editor = await atom.workspace.open(path.join(target || '.', 'doc.go'))
})