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

Configure Feed

Select the types of activity you want to include in your feed.

various

Ducky 22e8b8fc cc0b426c

+55 -36
+1 -1
.tangled/workflows/build.yaml
··· 17 17 - shellcheck 18 18 19 19 environment: 20 - ATFILE_DEVEL_PUBLISH: "0" 20 + ATFILE_DEVEL_ENABLE_PUBLISH: "0" 21 21 22 22 steps: 23 23 - name: "Build"
+30 -4
README.md
··· 75 75 * **Haiku** 76 76 * Install: `/boot/system/non-packaged/bin/atfile` 77 77 * Config: `$HOME/config/settings/atfile.env` 78 - * `$HOME` is **always** `/home` on Haiku 79 78 80 79 #### Manually 81 80 ··· 99 98 100 99 To compile, run `./atfile.sh build`. The built version will be available at `./bin/atfile-<version>[+git.<hash>].sh`. 101 100 102 - _(That was easy, huh?)_ 101 + ### Environment variables 102 + 103 + Various environment variables can be exported to control various aspects of the development version. These are as follows: 104 + 105 + * `ATFILE_DEVEL_ENABLE_PIPING` <em>&lt;int&gt; (default: `0`)</em><br />Allow piping (useful to test installation) _(e.g. `cat ./atfile.sh | bash`)_ 106 + * `ATFILE_DEVEL_ENABLE_PUBLISH` <em>&lt;int&gt; (default: `0`)</em><br />Publish build to ATProto repository (to allow for updating) as the last step when running `release`. Several requirements must be fulfilled to succeed: 107 + * `ATFILE_DEVEL_DIST_USERNAME` must be set<br />By default, this is set to `$did` in `atfile.sh` (see **๐Ÿ—๏ธ Building โž” Meta**). Ideally, you should not set this variable as updates in the built version will not be fetched from the correct place 108 + * `ATFILE_DEVEL_DIST_PASSWORD` must be set 109 + * No tests should return an **Error** (**Warning** is acceptable) 110 + * Git commit must be <a href="https://git-scm.com/docs/git-tag">tagged</a> 111 + 112 + Other `ATFILE_DEVEL_` environment variables are visible in the codebase, but these are computed internally and cannot be set/modified. 113 + 114 + ### Directives 115 + 116 + Various build directives can be set in files to control various aspects of the development version. These are set with `# atfile-devel=` directive at the top of the file, using commas to separate values. These are as follows: 117 + 118 + * `ignore-build`<br />Do not include file in the final compiled build 119 + 120 + ### Meta 121 + 122 + Various meta variables can be set to be available in the final compiled build (usually found in `help`). These are found in `atfile.sh` under `# Meta`. These variables are as follows: 123 + 124 + * `author` <em>&lt;string&gt;</em><br />Copyright author 125 + * `did` <em>&lt;did&gt;</em><br />DID of copyright author. Also used as the source for published builds, unless `ATFILE_DEVEL_DIST_USERNAME` is set (see **๐Ÿ—๏ธ Building โž” Environment variables**) 126 + * `repo` <em>&lt;uri&gt;</em><br />Repository URL of source code 127 + * `version` <em>&lt;string&gt;</em><br />Version in the format of `<major>.<minor>[.<patch>]`. **Not following this format will cause unintended issues.** Git hashes (`+git.abc1234`) are added automatically during build when a <a href="https://git-scm.com/docs/git-tag">git tag</a> is **not** applied to the current commit 128 + * `year` <em>&lt;int&gt;</em><br />Copyright year 103 129 104 130 ## โŒจ๏ธ Contributing 105 131 106 - Development mainly takes place on [Tangled](https://tangled.sh/@zio.sh/atfile), with [GitHub](https://github.com/ziodotsh/atfile) acting as a mirror. If possible, please use Tangled for your contributions: since it is powered by ATProto, you can log in using your Bluesky account. 132 + Development takes place on [Tangled (@zio.sh/atfile)](https://tangled.sh/@zio.sh/atfile), with [GitHub (ziodotsh/atfile)](https://github.com/ziodotsh/atfile) acting as a mirror. Use Tangled for your contributions, for both <a href="https://tangled.org/@zio.sh/atfile/issues">Issues</a> and <a href="https://tangled.org/@zio.sh/atfile/pulls">Pulls</a>. As Tangled is powered by ATProto, you already have an account (unsure? Try <a href="https://tangled.org/login">logging in with your Bluesky handle</a>). 107 133 108 - When submitting Pull Requests, **target the `dev` branch**: `main` is the current stable production version, and PRs will be rejected targeting this branch. 134 + When submitting Pulls, **target the `dev` branch**: `main` is the current stable production version, and Pulls will be rejected targeting this branch. 109 135 110 136 ## ๐Ÿค Acknowledgements 111 137
+6 -13
atfile.sh
··· 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 release`: the 23 - # resulting file will be created at './bin/atfile-$version.sh'. Set variables 24 - # below (under '# Meta') to adjust various properties: these will be adjusted 25 - # during build automatically. 26 - # 27 - # Published releases are also done from here. This is done with: 28 - # * Setting ATFILE_DEVEL_PUBLISH to '1' 29 - # * Setting ATFILE_DIST_USERNAME to 'did:web:zio.sh' (default) 30 - # * This account will become the source of updates for this published build 31 - # * Setting ATFILE_DIST_PASSWORD to the above account's password 32 - # * Running `./atfile.sh release`. After build, the resulting file is uploaded 22 + # To produce a single-file build of ATFile, run `./atfile.sh build`: the 23 + # resulting file will be created at './bin/atfile-$version.sh'. 24 + # See README.md โž” '๐Ÿ—๏ธ Building' for more details. 33 25 # 34 26 # Being a fairly atypical codebase, please don't hesitate to get in touch if 35 27 # you're wanting to contribute but bewildered by this hot mess. Message ··· 58 50 unset ATFILE_DEVEL_DIR 59 51 unset ATFILE_DEVEL_ENTRY 60 52 unset ATFILE_DEVEL_SOURCE 53 + [[ -z "$ATFILE_DEVEL_ENABLE_PIPING" ]] && ATFILE_DEVEL_ENABLE_PIPING=0 61 54 62 - if [[ $ATFILE_DEVEL_ALLOW_PIPING != 1 ]]; then 55 + if [[ $ATFILE_DEVEL_ENABLE_PIPING != 1 ]]; then 63 56 if [ -p /dev/stdin ] ||\ 64 57 [[ "$0" == "bash" || $0 == *"/bin/bash" ]]; then 65 - atfile.devel.die "Piping is not supported\n โ†ณ Set ATFILE_DEVEL_ALLOW_PIPING=1 to ignore" 58 + atfile.devel.die "Piping is disabled\n โ†ณ Set ATFILE_DEVEL_ENABLE_PIPING=1 to ignore" 66 59 fi 67 60 fi 68 61
+3 -3
src/commands/help.sh
··· 53 53 โ„น๏ธ Make sure the necessary GPG key has been imported first" 54 54 55 55 usage_commands_devel="Commands (Devel) 56 - release 57 - Build (and release) as one file (to ./bin) 58 - โ„น๏ธ Set ${_envvar_prefix}_DEVEL_PUBLISH=1 to upload release" 56 + build 57 + Build (and release, if requested) as one file (to ./bin) 58 + โ„น๏ธ Set ${_envvar_prefix}_DEVEL_ENABLE_PUBLISH=1 to upload release" 59 59 60 60 usage_commands_lifecycle="Commands (Lifecycle) 61 61 update
-1
src/commands/install.sh
··· 1 1 #!/usr/bin/env bash 2 - # atfile-release=ignore 3 2 4 3 function atfile.install() { 5 4 override_path="$1"
+5 -5
src/commands/release.sh
··· 1 1 #!/usr/bin/env bash 2 - # atfile-release=ignore 2 + # atfile-devel=ignore-build 3 3 4 4 function atfile.release() { 5 5 # shellcheck disable=SC2154 ··· 10 10 local value="$2" 11 11 local found_line 12 12 13 - found_line="$(grep '^# atfile-release=' "$file" | head -n1)" 13 + found_line="$(grep '^# atfile-devel=' "$file" | head -n1)" 14 14 if [[ -n "$found_line" ]]; then 15 15 local devel_values="${found_line#*=}" 16 16 IFS=',' read -ra arr <<< "$devel_values" ··· 73 73 for s in "${ATFILE_DEVEL_INCLUDES[@]}" 74 74 do 75 75 if [[ -f "$s" ]]; then 76 - if [[ $(atfile.release.get_devel_value "$s" "ignore" == 1 ) ]]; then 76 + if [[ $(atfile.release.get_devel_value "$s" "ignore-build" == 1 ) ]]; then 77 77 echo "โ†ณ Ignoring: $s" 78 78 else 79 79 echo "โ†ณ Compiling: $s" ··· 157 157 chmod +x "$dist_path" 158 158 159 159 # shellcheck disable=SC2154 160 - if [[ $_devel_publish == 1 ]]; then 160 + if [[ $_devel_enable_publish == 1 ]]; then 161 161 if [[ $test_error_count -gt 0 ]]; then 162 162 atfile.die "Unable to publish ($test_error_count errors detected)" 163 163 fi 164 164 165 165 atfile.say "---\nโœจ Updating..." 166 - atfile.auth "$_dist_username" "$_dist_password" 166 + atfile.auth "$_devel_dist_username" "$_devel_dist_password" 167 167 [[ $_version == *"+"* ]] && atfile.die "Cannot publish a Git version ($_version)" 168 168 169 169 atfile.say "โ†ณ Uploading '$dist_path'..."
+4 -3
src/commands/something_broke.sh
··· 68 68 $(atfile.something_broke.print_envvar "DEBUG") 69 69 $(atfile.something_broke.print_envvar "DEVEL") 70 70 $(atfile.something_broke.print_envvar "DEVEL_DIR") 71 + โ†ณ ${_envvar_prefix}_DEVEL_DIST_PASSWORD: $([[ -n $(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_DIST_PASSWORD") ]] && echo "(Set)") 72 + $(atfile.something_broke.print_envvar "DEVEL_DIST_USERNAME" "$_devel_dist_username_default") 73 + $(atfile.something_broke.print_envvar "DEVEL_ENABLE_PIPING" "0") 74 + $(atfile.something_broke.print_envvar "DEVEL_ENABLE_PUBLISH" "$_devel_enable_publish_default") 71 75 $(atfile.something_broke.print_envvar "DEVEL_ENTRY") 72 76 โ†ณ ${_envvar_prefix}_DEVEL_INCLUDES: 73 77 $(for s in "${ATFILE_DEVEL_INCLUDES[@]}"; do echo " โ†ณ $s"; done) 74 78 $(atfile.something_broke.print_envvar "DEVEL_SOURCE") 75 - $(atfile.something_broke.print_envvar "DEVEL_PUBLISH" "$_devel_publish_default") 76 79 $(atfile.something_broke.print_envvar "DISABLE_AUTH_CHECK" "$_disable_auth_check_default") 77 80 $(atfile.something_broke.print_envvar "DISABLE_NI_EXIFTOOL" "$_disable_ni_exiftool_default") 78 81 $(atfile.something_broke.print_envvar "DISABLE_NI_MD5SUM" "$_disable_ni_md5sum_default") ··· 81 84 $(atfile.something_broke.print_envvar "DISABLE_UNSUPPORTED_OS_WARN" "$_disable_unsupported_os_warn") 82 85 $(atfile.something_broke.print_envvar "DISABLE_UPDATE_CHECKING" "$_disable_update_checking_default") 83 86 $(atfile.something_broke.print_envvar "DISABLE_UPDATE_COMMAND" "$_disable_update_command_default") 84 - โ†ณ ${_envvar_prefix}_DIST_PASSWORD: $([[ -n $(atfile.util.get_envvar "${_envvar_prefix}_DIST_PASSWORD") ]] && echo "(Set)") 85 - $(atfile.something_broke.print_envvar "DIST_USERNAME" "$_dist_username_default") 86 87 $(atfile.something_broke.print_envvar "ENABLE_FINGERPRINT" "$_enable_fingerprint_default") 87 88 $(atfile.something_broke.print_envvar "ENABLE_UPDATE_GIT_CLOBBER" "$_enable_update_git_clobber") 88 89 $(atfile.something_broke.print_envvar "ENDPOINT_APPVIEW" "$_endpoint_appview_default")
+6 -6
src/entry.sh
··· 136 136 137 137 ### Defaults 138 138 139 - _devel_publish_default=0 139 + _devel_dist_username_default="$_meta_did" 140 + _devel_enable_publish_default=0 140 141 _disable_auth_check_default=0 141 142 _disable_ni_exiftool_default=0 142 143 _disable_ni_md5sum_default=0 ··· 145 146 _disable_unsupported_os_warn_default=0 146 147 _disable_update_checking_default=0 147 148 _disable_update_command_default=0 148 - _dist_username_default="$_meta_did" 149 149 _enable_fingerprint_default=0 150 150 _enable_update_git_clobber_default=0 151 151 #_endpoint_appview_default="https://bsky.zio.blue" ··· 163 163 164 164 ### Set 165 165 166 - _devel_publish="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_PUBLISH" $_devel_publish_default)" 166 + _devel_dist_password="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_DIST_PASSWORD")" 167 + _devel_dist_username="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_DIST_USERNAME" $_devel_dist_username_default)" 168 + _devel_enable_publish="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_ENABLE_PUBLISH" $_devel_enable_publish_default)" 167 169 _disable_auth_check="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_AUTH_CHECK" "$_disable_auth_check_default")" 168 170 _disable_ni_exiftool="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_NI_EXIFTOOL" "$_disable_ni_exiftool_default")" 169 171 _disable_ni_md5sum="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_NI_MD5SUM" "$_disable_ni_md5sum_default")" ··· 172 174 _disable_unsupported_os_warn="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_UNSUPPORTED_OS_WARN" "$_disable_unsupported_os_warn_default")" 173 175 _disable_update_checking="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_UPDATE_CHECKING" $_disable_update_checking_default)" 174 176 _disable_update_command="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_UPDATE_COMMAND" $_disable_update_command_default)" 175 - _dist_password="$(atfile.util.get_envvar "${_envvar_prefix}_DIST_PASSWORD")" 176 - _dist_username="$(atfile.util.get_envvar "${_envvar_prefix}_DIST_USERNAME" $_dist_username_default)" 177 177 _enable_fingerprint="$(atfile.util.get_envvar "${_envvar_prefix}_ENABLE_FINGERPRINT" "$_enable_fingerprint_default")" 178 178 _enable_update_git_clobber="$(atfile.util.get_envvar "${_envvar_prefix}_ENABLE_UPDATE_GIT_CLOBBER" "$_enable_update_git_clobber_default")" 179 179 _endpoint_appview="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_APPVIEW" "$_endpoint_appview_default")" ··· 214 214 atfile.util.print_override_envvar_debug "Copyright Author" "_meta_author" 215 215 [[ -n $_force_meta_did ]] && \ 216 216 _meta_did="$_force_meta_did" &&\ 217 - _dist_username="$(atfile.util.get_envvar "${_envvar_prefix}_DIST_USERNAME" "$_meta_did")" &&\ 217 + _devel_dist_username="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_DIST_USERNAME" "$_meta_did")" &&\ 218 218 atfile.util.print_override_envvar_debug "DID" "_meta_did" 219 219 [[ -n $_force_meta_repo ]] && \ 220 220 _meta_repo="$_force_meta_repo" &&\