File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22# Helpers for node.js
33
4+ # shellcheck source=../lib/logging.sh
5+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) /../lib/logging.sh"
6+
47# shellcheck source=../lib/shell.sh
58source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) /../lib/shell.sh"
69
710yarn_install_if_needed () {
811 local stateFile=" node_modules/devbase.lock"
912
13+ if [[ ! -e " package.json" ]]; then
14+ warn " No package.json found, skipping yarn install"
15+ return
16+ fi
17+
1018 if ! yarn -v > /dev/null 2>&1 ; then
1119 npm install -g yarn
1220 fi
Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ source "$DIR/languages/nodejs.sh"
1010extensions=(yaml yml json md ts)
1111
1212PRETTIER=" node_modules/.bin/prettier"
13+ if [[ ! -f $PRETTIER ]] && [[ ! -f package.json ]]; then
14+ # Try to find prettier installed via mise
15+ PRETTIER=" $( mise which prettier) "
16+ if [[ -z $PRETTIER ]]; then
17+ fatal " prettier not found in repo, make sure 'npx:prettier' is defined in 'mise.toml' and you have run 'mise install'"
18+ fi
19+ fi
1320
1421prettier_log_level_flag () {
1522 if [[ $( " $PRETTIER " --version) =~ ^2 ]]; then
You can’t perform that action at this time.
0 commit comments