#!/bin/bash owner=$(printenv REPL_OWNER) slug=$(printenv REPL_SLUG) echo -e "\n===== Uploading: $owner/$slug =====\n" if [[ ! -f ./index.html ]]; then echo "You don't appear to have an index.html file here. ByteForge only supports static sites." exit 1 fi # zip the current code echo -e "> Zipping Files...\n" # run zip from nix nix-shell -p zip --run "zip -r repl_code.zip ./ > /dev/null 2>&1" # upload to the server echo -e "> Uploading...\n" #upload to ByteForge server curl \ -X POST \ -F "code=@./repl_code.zip" \ -F "owner=$owner" \ -F "project=$slug" \ https://byteforge.steed.yachts/upload \ > /dev/null 2>&1 #clean up echo -e "> Cleaning Up...\n" rm repl_code.zip echo -e "> Done!\n\nhttps://byteforge.steed.yachts/$owner/$slug/"