Base state file path on sorted project paths

This commit is contained in:
Max Brunsfeld
2015-02-26 12:50:56 -08:00
parent fdda26a0a3
commit ddcb874f6b
2 changed files with 2 additions and 2 deletions

View File

@@ -149,6 +149,6 @@ describe "the `atom` global", ->
atom1 = Atom.loadOrCreate("editor")
expect(atom1.state.stuff).toBeUndefined()
loadSettings.initialPaths = [dir1, dir2]
loadSettings.initialPaths = [dir2, dir1]
atom2 = Atom.loadOrCreate("editor")
expect(atom2.state.stuff).toBe("cool")

View File

@@ -96,7 +96,7 @@ class Atom extends Model
filename = 'spec'
when 'editor'
if paths?.length > 0
sha1 = crypto.createHash('sha1').update(paths.join("\n")).digest('hex')
sha1 = crypto.createHash('sha1').update(paths.slice().sort().join("\n")).digest('hex')
filename = "editor-#{sha1}"
if filename