Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions lib/package-generator-view.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{View} = require 'space-pen'
Editor = require 'editor'
BufferedProcess = require 'buffered-process'
$ = require 'jquery'
_ = require 'underscore'
fsUtils = require 'fs-utils'
{_, $, BufferedProcess, Editor, fs, View} = require 'atom'
path = require 'path'

module.exports =
Expand Down Expand Up @@ -52,7 +47,7 @@ class PackageGeneratorView extends View
path.join(path.dirname(packagePath), packageName)

validPackagePath: ->
if fsUtils.exists(@getPackagePath())
if fs.exists(@getPackagePath())
@error.text("Path already exists at '#{@getPackagePath()}'")
@error.show()
false
Expand Down
9 changes: 4 additions & 5 deletions spec/package-generator-spec.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RootView = require 'root-view'
fsUtils = require 'fs-utils'
{fs, RootView} = require 'atom'
path = require 'path'

describe 'Package Generator', ->
Expand Down Expand Up @@ -36,10 +35,10 @@ describe 'Package Generator', ->

packageName = "sweet-package-dude"
packagePath = "/tmp/atom-packages/#{packageName}"
fsUtils.remove(packagePath) if fsUtils.exists(packagePath)
fs.remove(packagePath) if fs.exists(packagePath)

afterEach ->
fsUtils.remove(packagePath) if fsUtils.exists(packagePath)
fs.remove(packagePath) if fs.exists(packagePath)

it "forces the package's name to be lowercase with dashes", ->
packageName = "CamelCaseIsForTheBirds"
Expand Down Expand Up @@ -84,7 +83,7 @@ describe 'Package Generator', ->

it "displays an error when the package path already exists", ->
rootView.attachToDom()
fsUtils.makeTree(packagePath)
fs.makeTree(packagePath)
rootView.trigger("package-generator:generate-package")
packageGeneratorView = rootView.find(".package-generator").view()

Expand Down