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

Configure Feed

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

dev โž” issue/21-termux-install

Ducky 7c76bc88 501a97a6

+30 -23
+3 -1
README.md
··· 102 102 103 103 Various environment variables can be exported to control various aspects of the development version. These are as follows: 104 104 105 + * `ATFILE_DEVEL_DIST_USERNAME` <em>&lt;string&gt;</em><br />_(Todo)_. During runtime, 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 106 + * `ATFILE_DEVEL_DIST_PASSWORD` <em>&lt;string&gt;</em><br />_(Todo)_ 105 107 * `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 108 * `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 109 + * `ATFILE_DEVEL_DIST_USERNAME` must be set 108 110 * `ATFILE_DEVEL_DIST_PASSWORD` must be set 109 111 * No tests should return an **Error** (**Warning** is acceptable) 110 112 * Git commit must be <a href="https://git-scm.com/docs/git-tag">tagged</a>
+1 -1
atfile.sh
··· 36 36 author="zio" 37 37 did="did:web:zio.sh" 38 38 repo="https://tangled.sh/@zio.sh/atfile" 39 - version="0.12.2" 39 + version="0.12.8" 40 40 year="$(date +%Y)" 41 41 42 42 # Entry
+2
src/commands/record.sh
··· 48 48 at_collection="$(atfile.util.parse_at_uri "$at_uri" "collection")" 49 49 at_rkey="$(atfile.util.parse_at_uri "$at_uri" "rkey")" 50 50 51 + atfile.say.debug "Resolved AT URI\nโ†ณ Actor: $at_actor\nโ†ณ Collection: $at_collection\nโ†ณ RKey: $at_rkey" 52 + 51 53 case "$sub_command" in 52 54 "create") 53 55 if [[ -z "$at_rkey" ]]; then
+11 -11
src/commands/release.sh src/commands/build.sh
··· 1 1 #!/usr/bin/env bash 2 2 # atfile-devel=ignore-build 3 3 4 - function atfile.release() { 4 + function atfile.build() { 5 5 # shellcheck disable=SC2154 6 6 [[ $_os != "linux" ]] && atfile.die "Only available on Linux (GNU)\nโ†ณ Detected OS: $_os" 7 7 8 - function atfile.release.get_devel_value() { 8 + function atfile.build.get_devel_value() { 9 9 local file="$1" 10 10 local value="$2" 11 11 local found_line ··· 22 22 fi 23 23 } 24 24 25 - function atfile.release.replace_template_var() { 25 + function atfile.build.replace_template_var() { 26 26 string="$1" 27 27 key="$2" 28 28 value="$3" ··· 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-build" == 1 ) ]]; then 76 + if [[ $(atfile.build.get_devel_value "$s" "ignore-build" == 1 ) ]]; then 77 77 echo "โ†ณ Ignoring: $s" 78 78 else 79 79 echo "โ†ณ Compiling: $s" ··· 101 101 if [[ $include_line == 1 ]]; then 102 102 if [[ $line == *"{:"* && $line == *":}"* ]]; then 103 103 # NOTE: Not using atfile.util.get_envvar() here, as confusion can arise from config file 104 - line="$(atfile.release.replace_template_var "$line" "meta_author" "$ATFILE_FORCE_META_AUTHOR")" 105 - line="$(atfile.release.replace_template_var "$line" "meta_did" "$ATFILE_FORCE_META_DID")" 106 - line="$(atfile.release.replace_template_var "$line" "meta_repo" "$ATFILE_FORCE_META_REPO")" 107 - line="$(atfile.release.replace_template_var "$line" "meta_year" "$ATFILE_FORCE_META_YEAR")" 108 - line="$(atfile.release.replace_template_var "$line" "version" "$ATFILE_FORCE_VERSION")" 104 + line="$(atfile.build.replace_template_var "$line" "meta_author" "$ATFILE_FORCE_META_AUTHOR")" 105 + line="$(atfile.build.replace_template_var "$line" "meta_did" "$ATFILE_FORCE_META_DID")" 106 + line="$(atfile.build.replace_template_var "$line" "meta_repo" "$ATFILE_FORCE_META_REPO")" 107 + line="$(atfile.build.replace_template_var "$line" "meta_year" "$ATFILE_FORCE_META_YEAR")" 108 + line="$(atfile.build.replace_template_var "$line" "version" "$ATFILE_FORCE_VERSION")" 109 109 fi 110 110 111 111 echo "$line" >> "$dist_path" ··· 179 179 \"checksum\": \"$checksum\" 180 180 }" 181 181 182 - atfile.say "โ†ณ Bumping current version..." 182 + atfile.say "---\nโฌ†๏ธ Bumping..." 183 183 # shellcheck disable=SC2154 184 - atfile.invoke.manage_record put "at://$_devel_dist_username/self.atfile.latest/self" "$latest_release_record" &> /dev/null 184 + atfile.record update "at://$_devel_dist_username/self.atfile.latest/self" "$latest_release_record" 185 185 fi 186 186 }
+2 -2
src/entry.sh
··· 291 291 previous_command="$_command" 292 292 293 293 case "$_command" in 294 + "release") _command="build" ;; 294 295 "open"|"print"|"c") _command="cat" ;; 295 296 "rm") _command="delete" ;; 296 297 "download"|"f"|"d") _command="fetch" ;; ··· 299 300 "--help"|"-h") _command="help" ;; 300 301 "get"|"i") _command="info" ;; 301 302 "ls") _command="list" ;; 302 - "build") _command="release" ;; 303 303 "did") _command="resolve" ;; 304 304 "sb") _command="something-broke" ;; 305 305 "js") _command="stream" ;; 306 306 "ul"|"u") _command="upload" ;; 307 + "--update"|"-U") _command="update" ;; 307 308 "ub") _command="upload-blob" ;; 308 309 "uc") _command="upload-crypt" ;; 309 - "--update"|"-U") _command="update" ;; 310 310 "get-url"|"b") _command="url" ;; 311 311 "--version"|"-V") _command="version" ;; 312 312 esac
+3 -1
src/shared/die.sh
··· 3 3 function atfile.die() { 4 4 message="$1" 5 5 6 + # shellcheck disable=SC2154 6 7 if [[ $_output_json != 1 ]]; then 7 8 atfile.say.die "$message" 8 9 else 9 10 echo -e "{ \"error\": \"$1\" }" | jq 10 11 fi 11 12 13 + # shellcheck disable=SC2154 12 14 [[ $_is_sourced == 0 ]] && exit 255 13 15 } 14 16 ··· 50 52 51 53 function atfile.die.unknown_command() { 52 54 command="$1" 53 - atfile.die "Unknown command '$1'" 55 + atfile.die "Unknown command '$command'" 54 56 }
+8 -7
src/shared/invoke.sh
··· 5 5 shift 6 6 args=("$@") 7 7 8 + # shellcheck disable=SC2154 8 9 if [[ $_is_sourced == 0 ]] && [[ $ATFILE_DEVEL_NO_INVOKE != 1 ]]; then 9 10 atfile.say.debug "Invoking '$command'...\nโ†ณ Arguments: ${args[*]}" 10 11 ··· 25 26 atfile.bsky_profile "$_username" 26 27 else 27 28 atfile.bsky_profile "${args[0]}" 29 + fi 30 + ;; 31 + "build") 32 + if [[ $ATFILE_DEVEL == 1 ]]; then 33 + atfile.build 34 + else 35 + atfile.die.unknown_command "$command" 28 36 fi 29 37 ;; 30 38 "cat") ··· 128 136 "rm"|"delete"|"d") atfile.record "delete" "${args[1]}" ;; 129 137 *) atfile.die.unknown_command "$(echo "$command ${args[0]}" | xargs)" ;; 130 138 esac 131 - ;; 132 - "release") 133 - if [[ $ATFILE_DEVEL == 1 ]]; then 134 - atfile.release 135 - else 136 - atfile.die.unknown_command "$command" 137 - fi 138 139 ;; 139 140 "resolve") 140 141 atfile.resolve "${args[0]}"