From 21abd8f8f12224c1615eb9e81da6ca5306a3433d Mon Sep 17 00:00:00 2001 From: plyght Date: Mon, 10 Feb 2025 13:13:59 -0500 Subject: [PATCH] Add installer --- .DS_Store | Bin 0 -> 8196 bytes build.zig | 9 ++++++--- install | 42 ++++++++++++++++++++++++++++++++++++++++++ layouts/.DS_Store | Bin 0 -> 6148 bytes 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 .DS_Store create mode 100644 install create mode 100644 layouts/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..08e2238e0a310648ded11efa7cd4c03476529332 GIT binary patch literal 8196 zcmeHM%Wl&^6upy%#-=KYcu3hGSz?=pmZnlGHffqHDglcc!2(c-Yb&+t*ir0|LKG=$ z_y>N0EnmXFu!1v>RJN0LQ-mUQZZvc3nR~|exihw}Lqx1Oa(9R-L}Z|FEN`G%V!WT1 z1uLkQ2S5fs9S6~=6GRU7%M0GRK`WpY&ife_XAt;tvc3I_ z71oM()=P$AY#1NxvuJE5-DDIuyTf;U?{yRf&V0M;yz#wpr~L3J3X`rMdP70*T@Nnr z-}<2&jhoRZbYsD_Wrty!W~W@4Om_AUs@Ai5eOk39`@8k3wYPULotnm@Cr_WBbk2i* z7=0B=5>vM^+LZg3HNU>h^?$O5VGxBqv~!M04vnB^KrW&ol+7vh8(!(CZ7wndGomod zEbwEbnI%LEUWkIn>#R5N+3`I!J96GD5{um%#v*rBxoDISi4Ze2!Hf+k$SK6vLRO&w zexIS~XvxgxtKb^%718sibGrncQW`Ai`GSt=h}!guY-(rq6l*`NkVz--Jfs%A1lFie zZjQm%LYi@(-?3J0}5S5GkJQu4XJw{2cx;Zy{M7}E6z0|6}324&_ ztfT^K@~kR6|8HOY{eLCTU7wUzKr8TX6kx@c-D+a2`AcbjSe|QJC?8R{ale^FK|v+b kaiB=YftP<6V%vf%=QI?~B%%fO-#-NC=fBWhSGQY%ziFJ6yZ`_I literal 0 HcmV?d00001 diff --git a/build.zig b/build.zig index 8064da6..872efee 100644 --- a/build.zig +++ b/build.zig @@ -2,11 +2,14 @@ const std = @import("std"); const zine = @import("zine"); pub fn build(b: *std.Build) !void { - zine.website(b, .{ - .title = "Flow Editor", - .host_url = "https://flow-editor.github.io", + _ = zine.website(b, .{ + .title = "flow editor", + .host_url = "https://flow-editor.dev", .content_dir_path = "content", .layouts_dir_path = "layouts", .assets_dir_path = "assets", }); + + const install_step = b.addInstallFile(b.path("install"), "install"); + b.getInstallStep().dependOn(&install_step.step); } \ No newline at end of file diff --git a/install b/install new file mode 100644 index 0000000..4a8ed5f --- /dev/null +++ b/install @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +REPO="neurocyte/flow" +INSTALL_DIR="/usr/local/bin" + +# detect os and architecture +OS="$(uname -s | tr '[:upper:]' '[:lower:]')" +if [ "$OS" = "darwin" ]; then + OS="macos" +fi + +ARCH="$(uname -m)" +case "$ARCH" in + x86_64) ARCH="x86_64" ;; + arm64) ARCH="aarch64" ;; +esac + +# get latest version tag from github releases api +VERSION=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | cut -d'"' -f4) +[ -z "$VERSION" ] && { echo "failed to fetch latest version"; exit 1; } + +# construct download url +FILENAME="flow-$VERSION-$OS-$ARCH" +EXT="tar.gz" +[ "$OS" = "windows" ] && EXT="zip" +URL="https://github.com/$REPO/releases/download/$VERSION/$FILENAME.$EXT" + +echo "downloading flow $VERSION..." +curl -L "$URL" -o "/tmp/$FILENAME.$EXT" + +echo "installing flow..." +if [ "$EXT" = "tar.gz" ]; then + tar -xzf "/tmp/$FILENAME.$EXT" -C "$INSTALL_DIR" +else + unzip -o "/tmp/$FILENAME.$EXT" -d "$INSTALL_DIR" +fi + +chmod +x "$INSTALL_DIR/flow" +rm "/tmp/$FILENAME.$EXT" +echo "flow installed successfully!" \ No newline at end of file diff --git a/layouts/.DS_Store b/layouts/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..864452b527296b0979bbe7977100b25e311146f3 GIT binary patch literal 6148 zcmeHKL2uJA6n^f?NT`r{VA3v=EOD*I2A#BNm#l0Dt^|z(OeG=F8j;0SldhAhN;$)i z*>%5!zXRX1U9_$%yCDRA((~s$zb}bDJ9bP&qBl-DKtY$<^mLS25aoavZ_8e`rIEIRjGQq`%=@ z-{G_y$M;#0s7X(a zi=@=t&@_0y@AuoA)9LR1K}Wvqc4r+q-G9~X$i2OT+06Ggp1(MJ+y9bZ6zVH_0TcL= zv^}*r2kzxPT3m*sB3H#ZTIb9;!=Y2aDc}@XrGQ;8yw<7&7k3Ic1^!zFczuv?#=v52 zP%j-Q^br8qL|7Z@{JY2;X)&-^8$=6C7%I?Eg*{>jLq}ZNyue~@(9lWP!-ud>7WRZ9 z^wV*FsnbaW23_eCa0)Ccux2jXy#Jr9KL0P0+?7+nDezAzAezVFaSvUxd+So?c(0Z4 sPjEKQs}265prW^8