2
0
mirror of https://github.com/qarmin/czkawka synced 2024-11-04 12:00:29 +00:00
czkawka/misc/cargo/PublishOther.sh
2021-11-22 06:48:07 +01:00

46 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
NUMBER="3.3.1"
CZKAWKA_PATH="/home/rafal"
cd "$CZKAWKA_PATH"
CZKAWKA_PATH="$CZKAWKA_PATH/czkawka"
rm -rf $CZKAWKA_PATH
git clone https://github.com/qarmin/czkawka.git "$CZKAWKA_PATH"
cd $CZKAWKA_PATH
git checkout "$NUMBER"
cd "$CZKAWKA_PATH/czkawka_cli"
sed -i "s/{ path = \"..\/czkawka_core\" }/\"=$NUMBER\"/g" "$CZKAWKA_PATH/czkawka_cli/Cargo.toml"
cargo package --allow-dirty
if [ $(echo $?) != "0" ]
then
echo "Cargo package failed CLI"
exit 1
fi
git reset --hard
cd "$CZKAWKA_PATH/czkawka_gui"
sed -i "s/{ path = \"..\/czkawka_core\" }/\"=$NUMBER\"/g" "$CZKAWKA_PATH/czkawka_gui/Cargo.toml"
cargo package --allow-dirty
if [ $(echo $?) != "0" ]
then
echo "Cargo package failed GUI"
exit 1
fi
git reset --hard
cd "$CZKAWKA_PATH/czkawka_cli"
sed -i "s/{ path = \"..\/czkawka_core\" }/\"=$NUMBER\"/g" "$CZKAWKA_PATH/czkawka_cli/Cargo.toml"
cargo publish --allow-dirty
git reset --hard
cd "$CZKAWKA_PATH/czkawka_gui"
sed -i "s/{ path = \"..\/czkawka_core\" }/\"=$NUMBER\"/g" "$CZKAWKA_PATH/czkawka_gui/Cargo.toml"
cargo publish --allow-dirty
git reset --hard