mirror of
https://github.com/vector-im/element-call.git
synced 2026-05-01 09:54:37 +00:00
update linking realted logic
- remove post-commit hook - remove .links.cjs enable/disable (instead just add/rm .pnpmfile.cjs) - rename pnpm links:enable -> pnpm links:on - rename pnpm links:disable -> pnpm links:off - unify doc filenames `-` -> `_` - add linking_concept_reasoning.md to provide background why the linking is how it is.
This commit is contained in:
26
scripts/setup-linking.sh
Executable file
26
scripts/setup-linking.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Checks if there currently is linking configured. Informs the user to disable linking before committing.
|
||||
|
||||
LINKSFILE=.links.cjs
|
||||
echo "Checking for existing linking configuration in $LINKSFILE..."
|
||||
if test -f "$LINKSFILE"; then
|
||||
echo "Linking configuration found in $LINKSFILE."
|
||||
else
|
||||
echo "No $LINKSFILE -> Creating $LINKSFILE with default values. Please edit this file to point to your local checkouts of the dependencies you want to link."
|
||||
echo '''// Packages to link to local checkouts
|
||||
module.exports = {
|
||||
"matrix-js-sdk": "../your/path/matrix-js-sdk",
|
||||
"matrix-widget-api": "../your/path/matrix-widget-api",
|
||||
};''' > $LINKSFILE
|
||||
fi
|
||||
echo "updating local git hookPath to .githooks"
|
||||
git config --local core.hooksPath .githooks
|
||||
echo ""
|
||||
echo "Setup complete."
|
||||
echo "Update: .links.cjs to your liking"
|
||||
echo "Run: 'pnpm links:on' to test your .links.cjs"
|
||||
echo "Run: 'git commit' with links enabled to test the git pre-commit hook."
|
||||
echo "Run: 'pnpm links:off' to be able to commit again"
|
||||
echo "Run: 'git config --local core.hooksPath \"\"' to allow committing with linking on (not recommended)"
|
||||
echo "Run: 'rm links.cjs' & 'git config --local core.hooksPath \"\"' to fully revert what this script did"
|
||||
Reference in New Issue
Block a user