Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In MAC, may be unenforceable directory, how can do before running scripts, automatically run chmod + x scripts/path/to/my/script #117

Open
laterdayi opened this issue Mar 27, 2023 · 7 comments

Comments

@laterdayi
Copy link

In MAC, may be unenforceable directory, how can do before running scripts, automatically run chmod + x scripts/path/to/my/script

Whether a pre-run hook function is provided

@laterdayi
Copy link
Author

In many cases, you're not sure if scripty won't run because it has insufficient permissions, and if scripty can provide a hook that gives you permissions manually or automatically before you run Scripty

@laterdayi
Copy link
Author

@searls @jasonkarns @rosston Look forward to help

@jasonkarns
Copy link
Member

I'm not sure I understand the issue. The script that scripty is invoking should generally be versioned with the package and so should be committed with execute permissions.

@laterdayi
Copy link
Author

On mac, the node_modules/* dependency may not have permission the first time a clone project is installed, but "prepare": "scripty" will cause the run to fail ,

So is there a hook or function that can manually or automatically grant executable permissions to node_modules/* before running 'prepare' : 'scripty' or scripty

@laterdayi
Copy link
Author

@jasonkarns

@laterdayi
Copy link
Author

  "config": {
    "scripty":{
      "path":"node_modules/*/scripts",
      "windowsPath":"node_modules/*/scripts-win"
    },
  }

When I set the scripty path to an npm package A and I install A, scripty may be inaccessible

@jasonkarns
Copy link
Member

On mac, the node_modules/* dependency may not have permission the first time a clone project is installed,

I (and most of the devs who have worked on scripty) use mac, and have never had this issue. Under what circumstances would a project's clone not have permission to execute?

Which version of npm are you using? I recall in old versions of npm, many of the install hooks (preinstall, install, prepare) would have race conditions between the hook scripts and dependency installation. It was not possible to rely on dependencies (like scripty) being installed prior to the hook scripts running.

Judging by the documentation for npm 9 (I haven't tested again myself), they seem to indicate that dependencies are now installed prior to running these hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants