diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..08e2238 Binary files /dev/null and b/.DS_Store differ 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 0000000..864452b Binary files /dev/null and b/layouts/.DS_Store differ