Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

type:"usr" commands as pseudo-files in /usr/local/bin #7

Open
bamkrs opened this issue Sep 26, 2017 · 0 comments
Open

type:"usr" commands as pseudo-files in /usr/local/bin #7

bamkrs opened this issue Sep 26, 2017 · 0 comments

Comments

@bamkrs
Copy link

bamkrs commented Sep 26, 2017

A nice feature would be to create pseudo-files in /usr/local/bin for every type:"usr" command.

As a quick hack it would be sufficient to add something like the following codeblock before
https://github.com/Kirkhammetz/termly.js/blob/5a7740303afe131ccecd673dc98c86d8657deb9e/bin/classes/Shell.js#L28

var usrlocalbin = {usr:{local:{bin:{}}}}
Object.keys(commands).map((key) => {
    const cmd = Blueprints[key]
    if (cmd.type === "usr"){
         usrlocalbin.usr.local.bin[key] = "<binary content ommited>"
    }
})
filesystem = Object.assign(filesystem,usrlocalbin)

This way, the "usr" commands would be present in /usr/local/bin as they would be in a real *nix environment. Alternatively one could use the prototype of the command as "filecontent".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant