Merge pull request #2364 from ethereum/migrate_file_system
Migrate file system to using BrowserFSpull/5370/head
commit
aab8c23eb7
@ -0,0 +1,18 @@ |
||||
|
||||
import { Storage } from 'remix-lib' |
||||
|
||||
/* |
||||
Migrating the files to the BrowserFS storage instead or raw localstorage |
||||
*/ |
||||
export default (fileProvider) => { |
||||
const fileStorage = new Storage('sol:') |
||||
if (fileStorage.keys().length === 0) return |
||||
fileStorage.keys().forEach((path) => { |
||||
if (path !== '.remix.config') { |
||||
const content = fileStorage.get(path) |
||||
fileProvider.set(path, content) |
||||
fileStorage.remove(path) |
||||
console.log('file migrated', path) |
||||
} |
||||
}) |
||||
} |
Loading…
Reference in new issue