dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Allow `eject` to copy from absolute paths #193

Closed mwistrand closed 6 years ago

mwistrand commented 6 years ago

Enhancement

When ejecting, it may be desirable for commands to inline their rc options with the other ejected files by creating a temporary file and then adding that file to EjectOutput.copy. However, @dojo/cli currently only allows files within the project directory to be copied.

Package Version: v0.4.0

Code

const command = {
    eject() {
        const rcPath = `${os.tmpdir()}/command-options.json`;
        return {
            copy: {
                path: __dirname,
                files: [ rcPath ]
            }
        };
    }
};

Expected behavior:

command-options.json is copied to config/{group-name}/command-options.json.

Actual behavior:

An error is thrown: ENOENT: no such file or directory, open '/path/to/command-options.json'.