mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Originally we introduced this function because we thought empty directories were causing path length issues on Windows, but it turns out that it was a problem with Squirrel, so we can delete this code path altogether. Signed-off-by: Nathan Sobo <nathan@github.com>
20 lines
707 B
JavaScript
20 lines
707 B
JavaScript
'use strict'
|
|
|
|
const fs = require('fs-extra')
|
|
const path = require('path')
|
|
|
|
module.exports = function (packagedAppPath) {
|
|
if (process.platform === 'darwin') {
|
|
const packagedAppPathFileName = path.basename(packagedAppPath)
|
|
const installationDirPath = path.join(path.sep, 'Applications', packagedAppPathFileName)
|
|
if (fs.existsSync(installationDirPath)) {
|
|
console.log(`Removing previously installed ${packagedAppPathFileName} at ${installationDirPath}`)
|
|
fs.removeSync(installationDirPath)
|
|
}
|
|
console.log(`Installing ${packagedAppPath} at ${installationDirPath}`)
|
|
fs.copySync(packagedAppPath, installationDirPath)
|
|
} else {
|
|
throw new Error("Not implemented yet.")
|
|
}
|
|
}
|