mirror of
https://github.com/sebastiandine/Card-Collection-Manager-2.git
synced 2026-08-28 17:00:55 +00:00
29 lines
1.1 KiB
Bash
Executable File
29 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
PROJECT_ROOT=$(pwd)
|
|
|
|
# Check if version and project name are the same in all manifest files.
|
|
# TAURI_VERSION is the version that is actually used by the tauri build command,
|
|
# but to avoid any misconception, versions in all manifests should be the same.
|
|
cd $PROJECT_ROOT && cd card-collection-manager-2/src-tauri
|
|
CARGO_VERSION=$(cargo read-manifest | jq -r .version)
|
|
CARGO_NAME=$(cargo read-manifest | jq -r .name)
|
|
TAURI_VERSION=$(cat tauri.conf.json | jq -r .package.version)
|
|
TAURI_NAME=$(cat tauri.conf.json | jq -r .package.productName)
|
|
cd $PROJECT_ROOT && cd card-collection-manager-2
|
|
YARN_VERSION=$(cat package.json | jq -r .version)
|
|
YARN_NAME=$(cat package.json | jq -r .name)
|
|
|
|
if [ $CARGO_VERSION != $YARN_VERSION ] || [ $CARGO_VERSION != $TAURI_VERSION ] || [ $YARN_VERSION != $TAURI_VERSION ]; then
|
|
echo "[PRE-COMMIT] Project version in manifests does not match."
|
|
exit 1
|
|
fi
|
|
if [ $CARGO_NAME != $YARN_NAME ] || [ $CARGO_NAME != $TAURI_NAME ] || [ $YARN_NAME != $TAURI_NAME ]; then
|
|
echo "[PRE-COMMIT] Project name in manifests does not match."
|
|
exit 1
|
|
fi
|
|
|
|
cd $PROJECT_ROOT
|
|
echo $TAURI_VERSION > version
|
|
git add version
|
|
|
|
exit 0 |