mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Clear StorageFolder when --clear-window-state is supplied
This commit is contained in:
@@ -139,7 +139,9 @@ class AtomEnvironment extends Model
|
||||
|
||||
@stateStore = new StateStore('AtomEnvironments', 1)
|
||||
|
||||
@stateStore.clear() if clearWindowState
|
||||
if clearWindowState
|
||||
@getStorageFolder().clear()
|
||||
@stateStore.clear()
|
||||
|
||||
@deserializers = new DeserializerManager(this)
|
||||
@deserializeTimings = {}
|
||||
|
||||
@@ -6,6 +6,14 @@ class StorageFolder
|
||||
constructor: (containingPath) ->
|
||||
@path = path.join(containingPath, "storage") if containingPath?
|
||||
|
||||
clear: ->
|
||||
return unless @path?
|
||||
|
||||
try
|
||||
fs.removeSync(@path)
|
||||
catch error
|
||||
console.warn "Error deleting #{statePath}", error.stack, error
|
||||
|
||||
storeSync: (name, object) ->
|
||||
return unless @path?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user