-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Allow schematics to create file with permissions #11781
Copy link
Copy link
Open
Labels
area: @angular-devkit/schematicsfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors
Milestone
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/schematicsfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors
Bug Report or Feature Request (mark with an
x)Versions
any
Desired functionality
I'm writing schematics to help colleagues scaffold applications and libraries following our internal guidelines. One part of our set-up is the use of a file called
Taskfileto contain scripts instead of cramming complicated one-liners in yarn run-scripts. This file should be executable, but a schematic cannot create executable files. The result is a broken package because./Taskfile: Permission denied.I've got a simple workaround:
The schematic in question is based on
@schematics/angular:library. It runs theNodePackageInstallTaskat the end. This allows me to create a selfdestructingpreinstallscript in the newly scaffoldedpackage.json:{ "//": "...", "scripts": { "preinstall": "chmod +x Taskfile && ex +g/preinstall/d -cwq package.json", "prepublish": "./Taskfile build", "test": "./Taskfile test" } }This works, but it feels like a hack to me. It would be cleaner if either