bbc / speculate

Automatically generates an RPM Spec file for your Node.js project
Other
66 stars 28 forks source link

Fix: Creating a service file with a custom name falls back to the package.name when package.json has "files" #108

Closed matt-ahmet-bbc closed 8 months ago

matt-ahmet-bbc commented 8 months ago

Given we call speculate with --name argument, we see that it falls back to package.json's name when the package.json has also files defined.

// Example package.json
{
   "name": "foo",
   "files": ['path/1', 'path/2'],
}

npx speculate --name=penguin
> Error: ENOENT: no such file or directory, lstat '/Users/.../foo.service'

When we don't have "files" defined in our package.json, this works as expected and use the custom name defined.

matt-ahmet-bbc commented 8 months ago

Fixes https://github.com/bbc/speculate/issues/89 https://github.com/bbc/speculate/issues/78