question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow schematics to create file with permissions

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

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 Taskfile to 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 the NodePackageInstallTask at the end. This allows me to create a selfdestructing preinstall script in the newly scaffolded package.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

  • file permissions were respected, as the source file for the scaffold has correct permissions; or
  • the schematic could modify permissions

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
tinesoftcommented, Aug 2, 2021

I’m the author of that PR on https://github.com/nrwl/nx/issues/5680 😇.

I will submit a similar PR for the CLI, hoping it gets accepted as well. ^^

Cheers

1reaction
angular-robot[bot]commented, Feb 21, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn’t collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular’s scope, we’d encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change directory permissions in Linux - Pluralsight
Change Linux file permissions with the Linux chmod command, including chmod +rwx, chmod +x, chmod 777, and more.
Read more >
File Permissions and Sharing Files | Computing
First, it means that people in your group can create new files in that directory, but other people cannot.
Read more >
Understanding File Permissions and Using Them to Secure ...
File permissions specify who and what can read, write, modify, and access them. ... Read – allows access to a file to view...
Read more >
Access Permissions Control on each Schematic Sheet in XDx ...
Having a kind of private work-spaces can help to track the changes (when/who) made the change . Do we need any additional licenses...
Read more >
Learning the shell - Lesson 9: Permissions - LinuxCommand.org
In this tutorial we look at how Linux handles file permissions. ... nor would we allow one user to interfere with the files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found