[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
ng add will fail if assets/svg folder not exists
Expected behavior
ng add should not run npm run generate-icons if there is no svg folder / shouldn't run at all / console log instructions with next steps
Minimal reproduction of the problem with instructions
ng new svg-icons-test
ng add @ngneat/svg-icon
Output:
ng add @ngneat/svg-icon
Installing packages for tooling via npm.
Installed packages for tooling via npm.
✅️ Update package.json
🔍 Installing package...
✅️ @ngneat/svg-icon is imported
👏 @ngneat/svg-icon ready to use
UPDATE src/app/app.module.ts (459 bytes)
✔ Packages installed successfully.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svg-icons-test@0.0.0 generate-icons: `svg-to-ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svg-icons-test@0.0.0 generate-icons script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vladta/.npm/_logs/2021-01-19T09_32_51_893Z-debug.log
Unknown error: Error: Command failed: npm run generate-icons
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svg-icons-test@0.0.0 generate-icons: svg-to-ts
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svg-icons-test@0.0.0 generate-icons script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vladta/.npm/_logs/2021-01-19T09_32_51_893Z-debug.log
## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->
## Environment
<pre><code>
Angular version: X.Y.Z
<!-- Check whether this is still an issue in the most recent Angular version -->
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX <!-- run `node --version` -->
- Platform: <!-- Mac, Linux, Windows -->
Others:
<!-- Anything else relevant? Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>
I'm submitting a...
Current behavior
ng add will fail if
assets/svg
folder not existsExpected behavior
ng add should not run
npm run generate-icons
if there is no svg folder / shouldn't run at all / console log instructions with next stepsMinimal reproduction of the problem with instructions
ng new svg-icons-test
ng add @ngneat/svg-icon
npm ERR! A complete log of this run can be found in: npm ERR! /home/vladta/.npm/_logs/2021-01-19T09_32_51_893Z-debug.log Unknown error: Error: Command failed: npm run generate-icons npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! svg-icons-test@0.0.0 generate-icons:
svg-to-ts
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the svg-icons-test@0.0.0 generate-icons script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! /home/vladta/.npm/_logs/2021-01-19T09_32_51_893Z-debug.log