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

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

@bamkrs

Description

@bamkrs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions