···2727 * ๐ข **macOS**: Compatible with built-in version of Bash (3.2)
2828 * ๐ก **Windows**: MinGW (Cygwin, Git Bash, MSYS2, etc.) and WSL (see Linux caveats above)
2929 * This repository **does not** provide a native version for Windows
3030- * ๐ข **BSD**: FreeBSD, NetBSD and OpenBSD; other non-detected BSDs should work (see ยน)
3030+ * ๐ข __*BSD__: FreeBSD, NetBSD, OpenBSD, and other *BSD's
3131 * ๐ข **Haiku**: [Yes, really](https://bsky.app/profile/did:plc:kv7sv4lynbv5s6gdhn5r5vcw/post/3lboqznyqgs26)
3232 * ๐ด **Solaris**: <span title="Don't we all?">Has issues</span>; low priority
3333* **Bashยณ:** 3.x or later
···4343 * [`websocat`](https://github.com/vi/websocat) _(optional: needed for `stream`)_
4444* **ATProto account**
4545 * Both [Bluesky PBC-operated](https://bsky.social) and self-hosted accounts supported
4646- * If you're using a `bsky.network` (`@*.bsky.social`) account, limit the amount of files you upload to Bluesky PBC's servers. Heed the copyright warning: **do not upload copyrighted files.**
4646+ * If you're using a `bsky.network` (`@*.bsky.social`) account, limit the amount of files you upload to Bluesky PBC's servers. Heed the copyright warning: **do not upload copyrighted files**
4747 * `did:web` accounts supported!
4848 * Confirmed to work on [Bluesky PDS](https://github.com/bluesky-social/pds) and [millipds](https://github.com/DavidBuchanan314/millipds)
4949 * Other PDSs remain untested, but if they implement standard `com.atproto.*` endpoints, there should be no reason these won't work
···64646565This will automatically fetch the latest version of ATFile and install it in an appropriate location, as well as creating a blank configuration file. Once downloaded and installed, the locations used will be output. They are as follows:
66666767-* **Linux/Windows/BSD/Solaris**
6767+* __Linux/Windows/*BSD/Solaris__
6868 * Install: `$HOME/.local/bin/atfile`
6969 * As `sudo`/`root`: `/usr/local/bin/atfile`
7070 * Config: `$HOME/.config/atfile.env`
···123123124124* **ยน** You can bypass OS detection in one of two ways:
125125 * Set `ATFILE_SKIP_UNSUPPORTED_OS=1`<br />Be careful! There's a reason some OSes are not supported
126126- * Set `ATFILE_FORCE_OS=<os>`<br />This overrides the OS detected. Possible values:
127127- * BSD: `bsd-freebsd`, `bsd-netbsd`, `bsd-openbsd`
128128- * Linux: `linux`, `linux-mingw`, `linux-musl`, `linux-termux`
129129- * Other: `haiku`, `macos`, `solaris`
126126+ * Set `ATFILE_FORCE_OS=<os>`<br />This overrides the OS detected. Possible values: `bsd`, `haiku`, `linux`, `linux-mingw`, `linux-musl`, `linux-termux`, `macos`, `solaris`, `unknown`
130127* **ยฒ** musl-powered distros do not use GNU/glibc packages, and have problems currently
131128 * Known musl distros: Alpine, Chimera, Dragora, Gentoo (musl), Morpheus, OpenWrt, postmarketOS, Sabotage, Void
132129 * Bypassing OS detection (see ยน) will work, but dates will not be handled correctly
+5
atfile.sh
···5959unset ATFILE_DEVEL_ENTRY
6060unset ATFILE_DEVEL_SOURCE
61616262+#if [ -p /dev/stdin ] ||\
6363+# [[ "$0" == "bash" || $0 == *"/bin/bash" ]]; then
6464+# atfile.devel.die "Piping is not supported"
6565+#fi
6666+6267if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then
6368 ATFILE_DEVEL=1
6469 ATFILE_DEVEL_DIR="$(dirname "${BASH_SOURCE[0]}")"
+56-1
src/commands/install.sh
···11#!/usr/bin/env bash
2233function atfile.install() {
44- atfile.die "Not implemented"
44+ override_path="$1"
55+ override_version="$2"
66+77+ uid="$(id -u)"
88+ conf_file="atfile.env"
99+ install_file="atfile"
1010+ unset conf_dir
1111+ unset install_dir
1212+1313+ atfile.util.check_prog "curl"
1414+ atfile.util.check_prog "jq"
1515+1616+ if [[ $_os_supported == 0 ]]; then
1717+ atfile.die "Unsupported OS (${_os//unknown-/})"
1818+ fi
1919+2020+ if [[ $_os == "haiku" ]]; then
2121+ install_dir="/boot/system/non-packaged/bin"
2222+ conf_dir="$HOME/config/settings"
2323+ else
2424+ if [[ $uid == 0 ]]; then
2525+ install_dir="/usr/local/bin"
2626+2727+ if [[ -z $SUDO_DIR ]]; then
2828+ conf_dir="/root/.config"
2929+ else
3030+ if [[ $_os == "macos" ]]; then
3131+ conf_dir="$(eval echo ~"$SUDO_USER")/Library/Application Support"
3232+ else
3333+ conf_dir="$(eval echo ~"$SUDO_USER")/.config"
3434+ fi
3535+ fi
3636+ else
3737+ install_dir="$(eval echo ~"$USER")/.local/bin"
3838+ conf_dir="$(eval echo ~"$USER")/.config"
3939+4040+ if [[ $_os == "macos" ]]; then
4141+ conf_dir="$(eval echo ~"$USER")/Library/Application Support"
4242+ else
4343+ conf_dir="$(eval echo ~"$USER")/.config"
4444+ fi
4545+ fi
4646+4747+ # INVESTIGATE: What happens during `sudo`?
4848+ if [[ -n "$XDG_CONFIG_HOME" ]]; then
4949+ conf_dir="$XDG_CONFIG_HOME"
5050+ fi
5151+ fi
5252+5353+ [[ -n "$override_path" ]] && install_dir="$override_path"
5454+5555+ atfile.say.debug "Installing...\nโณ OS: $_os\nโณ Install: $install_dir/$install_file\nโณ Config: $conf_dir/$conf_file"
5656+5757+ if [[ -f "$install_dir/$install_file" ]]; then
5858+ atfile.die "Already installed ($install_dir/$install_file)"
5959+ fi
560}