mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Require project directories to exist on deserialization
This commit is contained in:
@@ -72,7 +72,7 @@ class Project extends Model
|
||||
bufferPromises.push(TextBuffer.deserialize(bufferState))
|
||||
Promise.all(bufferPromises).then (@buffers) =>
|
||||
@subscribeToBuffer(buffer) for buffer in @buffers
|
||||
@setPaths(state.paths)
|
||||
@setPaths(state.paths, mustExist: true)
|
||||
|
||||
serialize: (options={}) ->
|
||||
deserializer: 'Project'
|
||||
@@ -234,7 +234,7 @@ class Project extends Model
|
||||
if added
|
||||
@emitter.emit 'did-change-paths', projectPaths
|
||||
|
||||
if options.mustExist is true and missingProjectPaths
|
||||
if options.mustExist is true and missingProjectPaths.length > 0
|
||||
err = new Error "One or more project directories do not exist"
|
||||
err.missingProjectPaths = missingProjectPaths
|
||||
throw err
|
||||
|
||||
Reference in New Issue
Block a user