-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
449 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,63 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install pretty-quick --staged | ||
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then | ||
set -x | ||
fi | ||
|
||
if [ "$LEFTHOOK" = "0" ]; then | ||
exit 0 | ||
fi | ||
|
||
call_lefthook() | ||
{ | ||
if test -n "$LEFTHOOK_BIN" | ||
then | ||
"$LEFTHOOK_BIN" "$@" | ||
elif lefthook.exe -h >/dev/null 2>&1 | ||
then | ||
lefthook.exe "$@" | ||
elif lefthook.bat -h >/dev/null 2>&1 | ||
then | ||
lefthook.bat "$@" | ||
else | ||
dir="$(git rev-parse --show-toplevel)" | ||
osArch=$(uname | tr '[:upper:]' '[:lower:]') | ||
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') | ||
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" | ||
then | ||
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@" | ||
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" | ||
then | ||
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@" | ||
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" | ||
then | ||
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@" | ||
elif test -f "$dir/node_modules/lefthook/bin/index.js" | ||
then | ||
"$dir/node_modules/lefthook/bin/index.js" "$@" | ||
|
||
elif bundle exec lefthook -h >/dev/null 2>&1 | ||
then | ||
bundle exec lefthook "$@" | ||
elif yarn lefthook -h >/dev/null 2>&1 | ||
then | ||
yarn lefthook "$@" | ||
elif pnpm lefthook -h >/dev/null 2>&1 | ||
then | ||
pnpm lefthook "$@" | ||
elif swift package plugin lefthook >/dev/null 2>&1 | ||
then | ||
swift package --disable-sandbox plugin lefthook "$@" | ||
elif command -v mint >/dev/null 2>&1 | ||
then | ||
mint run csjones/lefthook-plugin "$@" | ||
elif command -v npx >/dev/null 2>&1 | ||
then | ||
npx lefthook "$@" | ||
else | ||
echo "Can't find lefthook in PATH" | ||
fi | ||
fi | ||
} | ||
|
||
call_lefthook run "pre-commit" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
|
||
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then | ||
set -x | ||
fi | ||
|
||
if [ "$LEFTHOOK" = "0" ]; then | ||
exit 0 | ||
fi | ||
|
||
call_lefthook() | ||
{ | ||
if test -n "$LEFTHOOK_BIN" | ||
then | ||
"$LEFTHOOK_BIN" "$@" | ||
elif lefthook.exe -h >/dev/null 2>&1 | ||
then | ||
lefthook.exe "$@" | ||
elif lefthook.bat -h >/dev/null 2>&1 | ||
then | ||
lefthook.bat "$@" | ||
else | ||
dir="$(git rev-parse --show-toplevel)" | ||
osArch=$(uname | tr '[:upper:]' '[:lower:]') | ||
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') | ||
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" | ||
then | ||
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@" | ||
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" | ||
then | ||
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@" | ||
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" | ||
then | ||
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@" | ||
elif test -f "$dir/node_modules/lefthook/bin/index.js" | ||
then | ||
"$dir/node_modules/lefthook/bin/index.js" "$@" | ||
|
||
elif bundle exec lefthook -h >/dev/null 2>&1 | ||
then | ||
bundle exec lefthook "$@" | ||
elif yarn lefthook -h >/dev/null 2>&1 | ||
then | ||
yarn lefthook "$@" | ||
elif pnpm lefthook -h >/dev/null 2>&1 | ||
then | ||
pnpm lefthook "$@" | ||
elif swift package plugin lefthook >/dev/null 2>&1 | ||
then | ||
swift package --disable-sandbox plugin lefthook "$@" | ||
elif command -v mint >/dev/null 2>&1 | ||
then | ||
mint run csjones/lefthook-plugin "$@" | ||
elif command -v npx >/dev/null 2>&1 | ||
then | ||
npx lefthook "$@" | ||
else | ||
echo "Can't find lefthook in PATH" | ||
fi | ||
fi | ||
} | ||
|
||
call_lefthook run "prepare-commit-msg" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
appcore/src/app/desktop/migration/desktop-registered-migrations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { DesktopMigration } from "./desktop-migrations.model"; | ||
import { Upgrade_7_0_0$beta_3 } from "./upgrade_7_0_0-beta.3/upgrade_7_0_0-beta.3"; | ||
import { Upgrade_7_0_0$beta_5 } from "./upgrade_7_0_0-beta.5/upgrade_7_0_0-beta.5"; | ||
import { Upgrade_7_2_0 } from "./upgrade_7_2_0/upgrade_7_2_0"; | ||
|
||
/** | ||
* Add desktop migrations inside LIST. The LIST is sorted from lowest to high versions | ||
*/ | ||
export class DesktopRegisteredMigrations { | ||
public static readonly LIST: DesktopMigration[] = [ | ||
new Upgrade_7_0_0$beta_3(), // To version 7.0.0-beta.3 | ||
new Upgrade_7_0_0$beta_5() // To version 7.0.0-beta.5 | ||
new Upgrade_7_0_0$beta_5(), // To version 7.0.0-beta.5 | ||
new Upgrade_7_2_0() // To version 7.2.0 | ||
/* Next Upgrade Here */ | ||
]; | ||
} |
14 changes: 14 additions & 0 deletions
14
appcore/src/app/desktop/migration/upgrade_7_2_0/upgrade_7_2_0.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { DesktopMigration } from "../desktop-migrations.model"; | ||
import { Injector } from "@angular/core"; | ||
|
||
export class Upgrade_7_2_0 extends DesktopMigration { | ||
public version: string = "7.2.0"; | ||
|
||
public description: string = "Trigger recalculation for efficiency new stats & settings lacks detection fix"; | ||
|
||
public requiresRecalculation: boolean = true; | ||
|
||
public upgrade(db: LokiConstructor, injector: Injector): Promise<void> { | ||
return Promise.resolve(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# EXAMPLE USAGE: | ||
# | ||
# Refer for explanation to following link: | ||
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md | ||
# | ||
pre-commit: | ||
parallel: true | ||
commands: | ||
lint: | ||
run: npx --no-install pretty-quick --staged |
Oops, something went wrong.