Merge branch 'master' of https://github.com/atom/atom into tests

This commit is contained in:
Steven Hobson-Campbell
2017-09-05 17:58:56 -07:00
28 changed files with 1879 additions and 1296 deletions

View File

@@ -1,18 +0,0 @@
@echo off
set USAGE=Usage: %0 source destination
if [%1] == [] (
echo %USAGE%
exit 1
)
if [%2] == [] (
echo %USAGE%
exit 2
)
:: rm -rf %2
if exist %2 rmdir %2 /s /q
:: cp -rf %1 %2
(robocopy %1 %2 /e) ^& IF %ERRORLEVEL% LEQ 1 exit 0

View File

@@ -47,6 +47,7 @@ const EXCLUDE_REGEXPS_SOURCES = [
escapeRegExp(path.join('build', 'Release', 'obj.target')),
escapeRegExp(path.join('build', 'Release', 'obj')),
escapeRegExp(path.join('build', 'Release', '.deps')),
escapeRegExp(path.join('deps', 'libgit2')),
escapeRegExp(path.join('vendor', 'apm')),
// These are only required in dev-mode, when pegjs grammars aren't precompiled
@@ -54,7 +55,6 @@ const EXCLUDE_REGEXPS_SOURCES = [
escapeRegExp(path.join('node_modules', 'pegjs')),
escapeRegExp(path.join('node_modules', '.bin', 'pegjs')),
escapeRegExp(path.join('node_modules', 'spellchecker', 'vendor', 'hunspell') + path.sep) + '.*',
escapeRegExp(path.join('build', 'Release') + path.sep) + '.*\\.pdb',
// Ignore *.cc and *.h files from native modules
escapeRegExp(path.sep) + '.+\\.(cc|h)$',
@@ -64,10 +64,14 @@ const EXCLUDE_REGEXPS_SOURCES = [
escapeRegExp(path.sep) + '.+\\.target.mk$',
escapeRegExp(path.sep) + 'linker\\.lock$',
escapeRegExp(path.join('build', 'Release') + path.sep) + '.+\\.node\\.dSYM',
escapeRegExp(path.join('build', 'Release') + path.sep) + '.*\\.(pdb|lib|exp|map|ipdb|iobj)',
// Ignore test and example folders
// Ignore node_module files we won't need at runtime
'node_modules' + escapeRegExp(path.sep) + '.*' + escapeRegExp(path.sep) + '_*te?sts?_*' + escapeRegExp(path.sep),
'node_modules' + escapeRegExp(path.sep) + '.*' + escapeRegExp(path.sep) + 'examples?' + escapeRegExp(path.sep)
'node_modules' + escapeRegExp(path.sep) + '.*' + escapeRegExp(path.sep) + 'examples?' + escapeRegExp(path.sep),
'node_modules' + escapeRegExp(path.sep) + '.*' + '\\.md$',
'node_modules' + escapeRegExp(path.sep) + '.*' + '\\.d\\.ts$',
'node_modules' + escapeRegExp(path.sep) + '.*' + '\\.js\\.map$'
]
// Ignore spec directories in all bundled packages

View File

@@ -3,7 +3,6 @@
const fs = require('fs-extra')
const handleTilde = require('./handle-tilde')
const path = require('path')
const runas = require('runas')
const template = require('lodash.template')
const CONFIG = require('../config')
@@ -31,11 +30,12 @@ module.exports = function (packagedAppPath, installDir) {
fs.copySync(packagedAppPath, installationDirPath)
} catch (e) {
console.log(`Administrator elevation required to install into "${installationDirPath}"`)
const copyScriptPath = path.join(CONFIG.repositoryRootPath, 'script', 'copy-folder.cmd')
const exitCode = runas('cmd', ['/c', copyScriptPath, packagedAppPath, installationDirPath], {admin: true})
if (exitCode !== 0) {
throw new Error(`Installation failed. "${copyScriptPath}" exited with status: ${exitCode}`)
}
const fsAdmin = require('fs-admin')
return new Promise((resolve, reject) => {
fsAdmin.recursiveCopy(packagedAppPath, installationDirPath, (error) => {
error ? reject(error) : resolve()
})
})
}
} else {
const atomExecutableName = CONFIG.channel === 'beta' ? 'atom-beta' : 'atom'
@@ -95,4 +95,6 @@ module.exports = function (packagedAppPath, installDir) {
console.log(`Changing permissions to 755 for "${installationDirPath}"`)
fs.chmodSync(installationDirPath, '755')
}
return Promise.resolve()
}

View File

@@ -13,6 +13,7 @@
"electron-mksnapshot": "~1.6",
"electron-packager": "7.3.0",
"electron-winstaller": "2.6.2",
"fs-admin": "^0.1.5",
"fs-extra": "0.30.0",
"glob": "7.0.3",
"joanna": "0.0.9",
@@ -25,7 +26,6 @@
"npm": "5.3.0",
"passwd-user": "2.1.0",
"pegjs": "0.9.0",
"runas": "3.1.1",
"season": "5.3.0",
"semver": "5.3.0",
"standard": "8.4.0",