mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Fix specs
This commit is contained in:
@@ -9,9 +9,7 @@ describe "install(commandPath, callback)", ->
|
||||
destinationPath = path.join(directory, 'bin', 'source')
|
||||
|
||||
beforeEach ->
|
||||
spyOn(installer, 'findInstallDirectory').andCallFake (callback) ->
|
||||
callback(directory)
|
||||
|
||||
spyOn(installer, 'getInstallDirectory').andReturn directory
|
||||
fs.removeSync(directory) if fs.existsSync(directory)
|
||||
|
||||
describe "on #darwin", ->
|
||||
|
||||
@@ -23,6 +23,9 @@ unlinkCommand = (destinationPath, callback) ->
|
||||
callback()
|
||||
|
||||
module.exports =
|
||||
getInstallDirectory: ->
|
||||
"/usr/local"
|
||||
|
||||
install: (commandPath, commandName, callback) ->
|
||||
if not commandName? or _.isFunction(commandName)
|
||||
callback = commandName
|
||||
@@ -33,7 +36,7 @@ module.exports =
|
||||
console.warn "Failed to install `#{commandName}` binary", error
|
||||
callback?(error, sourcePath, destinationPath)
|
||||
|
||||
directory = "/usr/local"
|
||||
directory = @getInstallDirectory()
|
||||
if fs.existsSync(directory)
|
||||
destinationPath = path.join(directory, 'bin', commandName)
|
||||
unlinkCommand destinationPath, (error) ->
|
||||
|
||||
Reference in New Issue
Block a user