mirror of
https://github.com/atom/atom.git
synced 2026-01-14 17:38:03 -05:00
21 lines
744 B
JavaScript
21 lines
744 B
JavaScript
'use strict'
|
|
|
|
const copySync = require('./copy-sync')
|
|
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}`)
|
|
copySync(packagedAppPath, installationDirPath)
|
|
} else {
|
|
throw new Error("Not implemented yet.")
|
|
}
|
|
}
|