๐Ÿ“ฆโž”๐Ÿฆ‹ Store and retrieve files on the Atmosphere

rename to Atfile

+35 -33
+3 -3
.tangled/workflows/build.yaml
··· 31 31 ATFILE_DEVEL_ENABLE_PUBLISH: "0" 32 32 33 33 steps: 34 - - name: "ATFile: List files for @zio.sh" 34 + - name: "Atfile: List files for @zio.sh" 35 35 command: "./atfile.sh ls zio.sh" 36 - - name: "ATFile: Print debug output" 36 + - name: "Atfile: Print debug output" 37 37 command: "./atfile.sh something-broke" 38 - - name: "ATFile: Build" 38 + - name: "Atfile: Build" 39 39 command: "./atfile.sh build"
+6 -6
README.md
··· 1 1 <h1 align="center"> 2 - ATFile 2 + Atfile 3 3 </h1> 4 4 5 5 <p align="center"> ··· 56 56 57 57 ### โฌ‡๏ธ Downloading & Installing 58 58 59 - There are three ways of installing ATFile. Either: 59 + There are three ways of installing Atfile. Either: 60 60 61 61 #### Automatic ("`curl|bash`") 62 62 ··· 64 64 curl -sSL https://zio.sh/atfile.sh | bash 65 65 ``` 66 66 67 - This 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: 67 + This 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: 68 68 69 69 * __Linux/*BSD/Solaris/SerenityOS__ 70 70 * Install: `$HOME/.local/bin/atfile` ··· 81 81 82 82 #### Manually 83 83 84 - See [tags on @zio.sh/atfile](https://tangled.org/@zio.sh/atfile/tags), and download the required version under **Artifacts** &mdash; this can be stored and run from anywhere (and is identical to the version `curl|bash` fetched. Consider renaming to `atfile.sh` (as ATFile can update itself, making a fixed version in the filename nonsensical), and mark as executable (with `chmod +x atfile.sh`). 84 + See [tags on @zio.sh/atfile](https://tangled.org/@zio.sh/atfile/tags), and download the required version under **Artifacts** &mdash; this can be stored and run from anywhere (and is identical to the version `curl|bash` fetched. Consider renaming to `atfile.sh` (as Atfile can update itself, making a fixed version in the filename nonsensical), and mark as executable (with `chmod +x atfile.sh`). 85 85 86 86 Config locations are identical to those above (see **Automatic ("`curl|bash`")** above). 87 87 88 88 #### Repository 89 89 90 - If you've pulled this repository, you can also use ATFile by simply calling `./atfile.sh` &mdash; it functions just as a regular compiled version of ATFile, including reading from the same config file. Debug messages are turned on by default: disable these by setting `ATFILE_DEBUG=0`. 90 + If you've pulled this repository, you can also use Atfile by simply calling `./atfile.sh` &mdash; it functions just as a regular compiled version of Atfile, including reading from the same config file. Debug messages are turned on by default: disable these by setting `ATFILE_DEBUG=0`. 91 91 92 92 Config locations are identical to those above (see **Automatic ("`curl|bash`")** above). 93 93 ··· 141 141 ## ๐Ÿค Acknowledgements 142 142 143 143 * **Paul Frazee** &mdash; [๐Ÿฆ‹ @pfrazee.com](https://bsky.app/profile/did:plc:ragtjsm2j2vknwkz3zp4oxrd)<br /><a href="https://bsky.app/profile/did:plc:ragtjsm2j2vknwkz3zp4oxrd/post/3l63zzvthqj2o">His kind words</a> 144 - * **Laurens Hof** &mdash; [๐Ÿฆ‹ @laurenshof.online](https://bsky.app/profile/did:plc:mdjhvva6vlrswsj26cftjttd)<br />Featuring ATFile on [The Fediverse Report](https://fediversereport.com): _["Last Week in the ATmosphere โ€“ Oct 2024 week 4"](https://fediversereport.com/last-week-in-the-atmosphere-oct-2024-week-4/)_ 144 + * **Laurens Hof** &mdash; [๐Ÿฆ‹ @laurenshof.online](https://bsky.app/profile/did:plc:mdjhvva6vlrswsj26cftjttd)<br />Featuring Atfile on [The Fediverse Report](https://fediversereport.com): _["Last Week in the ATmosphere โ€“ Oct 2024 week 4"](https://fediversereport.com/last-week-in-the-atmosphere-oct-2024-week-4/)_ 145 145 * All contributors on [Tangled](https://tangled.org/@zio.sh/atfile/pulls) and [GitHub](https://github.com/ziodotsh/atfile/pulls) 146 146 * _(Forgot about you? [You know what to do](https://tangled.sh/@zio.sh/atfile/pulls/new))_ 147 147
+9 -9
atfile.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 - # _ _____ _____ _ _ 4 - # / \|_ _| ___(_| | ___ 5 - # / _ \ | | | |_ | | |/ _ \ 6 - # / ___ \| | | _| | | | __/ 7 - # /_/ \_|_| |_| |_|_|\___| 3 + # _ _ __ _ _ 4 + # / \ | |_ / _(_) | ___ 5 + # / _ \| __| |_| | |/ _ \ 6 + # / ___ \ |_| _| | | __/ 7 + # /_/ \_\__|_| |_|_|\___| 8 8 # 9 9 # ------------------------------------------------------------------------------- 10 10 # 11 - # Welcome to ATFile's crazy Bash codebase! 11 + # Welcome to Atfile's crazy Bash codebase! 12 12 # 13 13 # Unless you're wanting to tinker, its recommended you install a stable version 14 - # of ATFile: see README for more. Using a development version against your 14 + # of Atfile: see README for more. Using a development version against your 15 15 # Atproto account could potentially inadvertently damage records. 16 16 # 17 - # Just as a published build, ATFile can be used entirely via this file. The 17 + # Just as a published build, Atfile can be used entirely via this file. The 18 18 # below code automatically sources everything for you, and your config (if 19 19 # it exists) is utilized as normal. Try running `./atfile.sh help`. To turn 20 20 # debug messages off, set ATFILE_DEBUG to '0'. 21 21 # 22 - # To produce a single-file build of ATFile, run `./atfile.sh build`: the 22 + # To produce a single-file build of Atfile, run `./atfile.sh build`: the 23 23 # resulting file will be created at './bin/atfile-$version.sh'. 24 24 # See README.md โž” '๐Ÿ—๏ธ Building' for more details. 25 25 #
+1 -1
examples/example.sh
··· 3 3 _atfile_path="$(dirname "$(realpath "$0")")/../atfile.sh" 4 4 5 5 if [[ ! -f "$_atfile_path" ]]; then 6 - echo -e "\033[1;31mError: ATFile not found (download: https://zio.sh/atfile)\033[0m" 6 + echo -e "\033[1;31mError: Atfile not found (download: https://zio.sh/atfile)\033[0m" 7 7 exit 0 8 8 fi 9 9
+2 -1
src/commands/build.sh
··· 81 81 echo "#!/usr/bin/env bash" > "$dist_path" 82 82 83 83 echo "โ†ณ Generating header..." 84 - echo -e "\n# ATFile <${ATFILE_FORCE_META_REPO}> 84 + # shellcheck disable=SC2154 85 + echo -e "\n# $_name <${ATFILE_FORCE_META_REPO}> 85 86 # --- 86 87 # Version: $_version 87 88 # Commit: $commit_hash
+2 -2
src/commands/handle.sh
··· 103 103 fi 104 104 else 105 105 atfile.die.gui \ 106 - "Invalid ATFile URI\nโ†ณ Must be 'atfile://<actor>/<key>'" \ 107 - "Invalid ATFile URI" 106 + "Invalid $_name URI\nโ†ณ Must be 'atfile://<actor>/<key>'" \ 107 + "Invalid $_name URI" 108 108 fi 109 109 }
+1 -1
src/commands/help.sh
··· 180 180 $_path_blobs_tmp/ 181 181 Cache and temporary storage" 182 182 183 - usage="ATFile" 183 + usage="$_name" 184 184 [[ $_os != "haiku" ]] && usage+=" | ๐Ÿ“ฆ โž” ๐Ÿฆ‹" 185 185 186 186 usage+="\n Store and retrieve files on the Atmosphere\n
+1 -1
src/commands/install.sh
··· 121 121 [[ $? != 0 ]] && die "Unable to create config file ($conf_dir/$_file_envvar)" 122 122 fi 123 123 124 - atfile.say "๐Ÿ˜Ž Installed ATFile" 124 + atfile.say "๐Ÿ˜Ž Installed $_name" 125 125 atfile.say " โ†ณ Version: $found_version" 126 126 atfile.say " โ†ณ Paths" 127 127 atfile.say " โ†ณ Install: $install_dir/$install_file"
+1 -1
src/commands/something_broke.sh
··· 99 99 fi 100 100 fi 101 101 102 - debug_output="ATFile 102 + debug_output="$_name 103 103 โ†ณ Version: $_version 104 104 โ†ณ UAS: $(atfile.util.get_uas) 105 105 โ†ณ Path: $_prog_path
+2 -2
src/commands/toggle-desktop.sh
··· 28 28 atfile.say "Installing '$desktop_path'..." 29 29 30 30 echo "[Desktop Entry] 31 - Name=ATFile (Handler) 32 - Description=Handle atfile:/at: URIs with ATFile 31 + Name=$_name (Handler) 32 + Description=Handle atfile:/at: URIs with $_name 33 33 Exec=$_prog_path handle %U 34 34 Terminal=false 35 35 Type=Application
+5 -4
src/entry.sh
··· 6 6 7 7 ### Permutation 8 8 9 - _start="$(atfile.util.get_date "" "%s")" # 1 10 - _envvar_prefix="ATFILE" # 2 11 - _debug="$(atfile.util.get_envvar "${_envvar_prefix}_DEBUG" "$([[ $ATFILE_DEVEL == 1 ]] && echo 1 || echo 0)")" # 3 12 - _force_os="$(atfile.util.get_envvar "${_envvar_prefix}_FORCE_OS")" # 3 9 + _start="$(atfile.util.get_date "" "%s")" # 2 10 + _name="Atfile" # 2 11 + _envvar_prefix="${_name^^}" # 3 12 + _debug="$(atfile.util.get_envvar "${_envvar_prefix}_DEBUG" "$([[ $ATFILE_DEVEL == 1 ]] && echo 1 || echo 0)")" # 4 13 + _force_os="$(atfile.util.get_envvar "${_envvar_prefix}_FORCE_OS")" # 5 13 14 14 15 ### Combination 15 16
+1 -1
src/lexi/blue_zio_atfile.sh
··· 194 194 }" 195 195 } 196 196 197 - # NOTE: Never intended to be used from ATFile. Here for reference 197 + # NOTE: Never intended to be used from Atfile. Here for reference 198 198 function blue.zio.atfile.finger__browser() { 199 199 url="$1" 200 200 userAgent="$2"
+1 -1
src/shared/util.sh
··· 746 746 747 747 function atfile.util.get_uas() { 748 748 # shellcheck disable=SC2154 749 - echo "ATFile/$_version" 749 + echo "$_name/$_version" 750 750 } 751 751 752 752 function atfile.util.get_xrpc_error() {