Open syntaxseed opened 5 years ago
Original Filesystem definition:
var originalFilesystem="<d name='/' path='/'>\
<c>\
<d name='docs' path='/docs/'>\
<c>\
<d name='private' path='/docs/private/'>\
<c>\
<f name='secret.txt' path='/docs/private/'>\
<contents>PxNmGkl6M+jDP4AYAKZET18SEnWD5qw5LIP9174lONWslF144K9VHFIk1JA=</contents>\
</f>\
</c>\
</d>\
<f name='shoplist.txt' path='/docs/'>\
<contents>-Apples\n-Bananas\n-Cookies</contents>\
</f>\
<f name='ok.txt' path='/docs/'>\
<contents>I am ok.</contents>\
</f>\
<f name='moretodo.txt' path='/docs/'>\
<contents>A, B, C.</contents>\
</f>\
</c>\
</d>\
<d name='more' path='/more/'>\
<c>\
<f name='moretodo.txt' path='/more/'>\
<contents>Don't forget this other stuff.</contents>\
</f>\
</c>\
</d>\
<d name='stuff' path='/stuff/'>\
<c>\
</c>\
</d>\
<f name='cool.txt' path='/'>\
<contents>There is a hidden command in this terminal called 'secret'.</contents>\
</f>\
</c>\
</d>";
After the merge of PR #13, we have a problem. The Initial Filesystem definition is not in a format that can be easily customized.
Need to read initial state from a Json file or similar.
Could be done by adding toPlain/restore methods in FileSystem class.
The raw, customizable definition should be found in js/filesystem.js.