This commit is contained in:
Brian Zalewski 2023-06-23 06:11:35 +00:00
parent db21a233a6
commit 355703286e

View file

@ -52,17 +52,17 @@
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
if command -v code > /dev/null && command -v pnpm > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/vscode/package.json" ]; then
if command -v code > /dev/null && command -v npm > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/vscode/package.json" ]; then
### Install linter fallback node_modules / package.json to system or home directory
if sudo cp -f "${XDG_DATA_HOME:-$HOME/.local/share}/vscode/package.json" /package.json; then
logg info 'Successfully copied linter fallback configurations package.json to /package.json'
logg info 'Installing system root directory node_modules'
cd / && sudo pnpm i --no-lockfile || EXIT_CODE=$?
cd / && sudo npm i --no-package-lock || EXIT_CODE=$?
else
logg warn 'Unable to successfully copy linter fallback configurations package.json to /package.json'
logg info 'Installing linter fallback configurations node_modules to home directory instead'
cp -f "${XDG_DATA_HOME:-$HOME/.local/share}/vscode/package.json" "$HOME/package.json"
cd ~ && pnpm i --no-lockfile || EXIT_CODE=$?
cd ~ && npm i --no-package-lock || EXIT_CODE=$?
fi
### Log message if install failed