mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
migrate packages to home manager
This commit is contained in:
18
update-intellij.sh
Executable file
18
update-intellij.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
nixFile="./packages/intellij.nix"
|
||||
info=$(curl --silent --fail --show-error "https://download.jetbrains.com/idea/ideaIU-$1.tar.gz.sha256")
|
||||
checksum=$(echo $info | grep -oE '^[0-9a-f]{64}')
|
||||
filename=$(echo $info | grep -oE '[^* ]+$')
|
||||
if [ -z "${checksum}" ] || [ -z "${filename}" ]; then
|
||||
exit -1
|
||||
fi
|
||||
echo "Filename: $filename"
|
||||
echo "Checksum: $checksum"
|
||||
|
||||
sed -i "s|version\s*=.*|version = \"$1\";|" "$nixFile"
|
||||
sed -i "s|url\s*=.*|url = \"https://download.jetbrains.com/idea/$filename\";|" "$nixFile"
|
||||
sed -i "s|sha256\s*=.*|sha256 = \"$checksum\";|" "$nixFile"
|
||||
|
||||
echo ""
|
||||
echo "IntelliJ updated to $1"
|
||||
|
||||
Reference in New Issue
Block a user