summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2020-08-17 13:02:02 +0200
committerAlan Pearce2020-08-17 13:02:13 +0200
commit48bc8200913fe8df1d15ad14f05264d1c7152411 (patch)
treee6d2020ee24eb63851a6af8ddc2c55fea4726168
parent31ea0c2f761b0fcd6d22204e18f784ca19c1a4ba (diff)
downloadnixfiles-48bc8200913fe8df1d15ad14f05264d1c7152411.tar.lz
nixfiles-48bc8200913fe8df1d15ad14f05264d1c7152411.tar.zst
nixfiles-48bc8200913fe8df1d15ad14f05264d1c7152411.zip
Add script to ease TabNine updates
-rwxr-xr-xupdate-tabnine.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/update-tabnine.sh b/update-tabnine.sh
new file mode 100755
index 00000000..19fe45df
--- /dev/null
+++ b/update-tabnine.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+function prefetch_target () {
+  nix-prefetch-url --type sha256 https://update.tabnine.com/$2/$1/TabNine 2> /dev/null
+}
+
+if [ -z "$1" ]; then
+  echo "Usage: $0 <version>"
+  exit 1
+fi
+
+echo "
+sha256 = if stdenv.isDarwin then
+\"$(prefetch_target x86_64-apple-darwin $1)\"
+else
+\"$(prefetch_target x86_64-unknown-linux-musl $1)\";"