mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Use fs-utils for directory check
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
EventEmitter = require './event-emitter'
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
fsUtils = require './fs-utils'
|
||||
pathWatcher = require 'pathwatcher'
|
||||
@@ -23,9 +22,7 @@ class File
|
||||
# * symlink:
|
||||
# A Boolean indicating if the path is a symlink (default: false)
|
||||
constructor: (@path, @symlink=false) ->
|
||||
try
|
||||
if fs.statSync(@path).isDirectorySync()
|
||||
throw new Error("#{@path} is a directory")
|
||||
throw new Error("#{@path} is a directory") if fsUtils.isDirectorySync(@path)
|
||||
|
||||
# Private: Sets the path for the file.
|
||||
setPath: (@path) ->
|
||||
|
||||
Reference in New Issue
Block a user