Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Initial FileSystem to load from a json file. #14

Open
syntaxseed opened this issue Oct 2, 2019 · 1 comment
Open

Refactor Initial FileSystem to load from a json file. #14

syntaxseed opened this issue Oct 2, 2019 · 1 comment
Labels
help wanted Extra attention or help is needed moderate Issue might require a moderate level of skill. refactoring Refactor existing code without changing behaviour.

Comments

@syntaxseed
Copy link
Owner

syntaxseed commented Oct 2, 2019

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.

@syntaxseed syntaxseed added on hold This issue is ON HOLD. refactoring Refactor existing code without changing behaviour. labels Oct 2, 2019
@syntaxseed
Copy link
Owner Author

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>";

@syntaxseed syntaxseed added help wanted Extra attention or help is needed moderate Issue might require a moderate level of skill. and removed on hold This issue is ON HOLD. labels Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention or help is needed moderate Issue might require a moderate level of skill. refactoring Refactor existing code without changing behaviour.
Projects
None yet
Development

No branches or pull requests

1 participant