πŸ“¦βž”πŸ¦‹ Store and retrieve files on the Atmosphere
35
fork

Configure Feed

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

entry: refactor

Ducky 0e8d773c 803045ee

+263 -255
+8 -16
src/commands/ai.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 3 function atfile.ai() { 4 - echo " 5 - βŠ‚_ヽ 6 - γ€€ οΌΌοΌΌ Ξ›οΌΏΞ› 7 - γ€€γ€€ οΌΌ( 'γ……' ) 8 - γ€€γ€€γ€€ >γ€€βŒ’γƒ½ 9 - γ€€γ€€γ€€/ γ€€ へ\ 10 - γ€€γ€€ /γ€€γ€€/γ€€οΌΌοΌΌ 11 - γ€€γ€€ οΎšγ€€γƒŽγ€€γ€€ ヽ_぀ 12 - γ€€γ€€/γ€€/ 13 - γ€€ /γ€€/| 14 - γ€€(γ€€(ヽ 15 - γ€€|γ€€|、\ 16 - γ€€| δΈΏ οΌΌ βŒ’) 17 - γ€€| |γ€€γ€€) / 18 - 'γƒŽ )γ€€γ€€LοΎ‰ 19 - " 4 + ai_art_record="$(com.atproto.repo.getRecord "did:plc:ragtjsm2j2vknwkz3zp4oxrd" "app.bsky.feed.post" "3jj2zikhvto2h")" 5 + error="$(atfile.util.get_xrpc_error $? "$ai_art_record")" 6 + 7 + if [[ -z "$error" ]]; then 8 + echo "$ai_art_record" | jq -r .value.text 9 + else 10 + echo ":(" 11 + fi 20 12 }
+20 -27
src/commands/auth.sh
··· 5 5 override_username="$1" 6 6 override_password="$2" 7 7 8 - function atfile.auth.get_command_segment() { 9 - # shellcheck disable=SC2154 10 - IFS=' ' read -r -a command_array <<< "$_command_full" 11 - index=$1 12 - 13 - echo "${command_array[index]}" 14 - } 15 - 16 8 [[ -n "$override_password" ]] && _password="$override_password" 17 9 [[ -n "$override_username" ]] && _username="$override_username" 18 10 ··· 23 15 if [[ -z $override_username ]] && [[ $_is_sourced == 0 ]]; then 24 16 # NOTE: Speeds things up a little if the user is overriding actor 25 17 # Keep this in-sync with the main case in `../entry.sh`! 26 - if [[ $_command == "cat" && -n "$(atfile.auth.get_command_segment 2)" ]] ||\ 27 - [[ $_command == "fetch" && -n "$(atfile.auth.get_command_segment 2)" ]] ||\ 28 - [[ $_command == "fetch-crypt" && -n "$(atfile.auth.get_command_segment 2)" ]] ||\ 29 - [[ $_command == "info" && -n "$(atfile.auth.get_command_segment 2)" ]] ||\ 30 - [[ $_command == "list" && "$(atfile.auth.get_command_segment 1)" == *.* ]] ||\ 31 - [[ $_command == "list" && "$(atfile.auth.get_command_segment 1)" == did:* ]] ||\ 32 - [[ $_command == "list" && -n "$(atfile.auth.get_command_segment 2)" ]] ||\ 33 - [[ $_command == "url" && -n "$(atfile.auth.get_command_segment 2)" ]]; then 34 - atfile.say.debug "Skipping identity resolving\n↳ Actor is overridden by command ('$_command_full')" 18 + if [[ $_command == "cat" && -n "${_command_args[1]}" ]] ||\ 19 + [[ $_command == "fetch" && -n "${_command_args[1]}" ]] ||\ 20 + [[ $_command == "fetch-crypt" && -n "${_command_args[1]}" ]] ||\ 21 + [[ $_command == "info" && -n "${_command_args[1]}" ]] ||\ 22 + [[ $_command == "list" && "${_command_args[0]}" == *.* ]] ||\ 23 + [[ $_command == "list" && "${_command_args[0]}" == did:* ]] ||\ 24 + [[ $_command == "list" && -n "${_command_args[1]}" ]] ||\ 25 + [[ $_command == "url" && -n "${_command_args[1]}" ]]; then 26 + atfile.say.debug "Skipping identity resolving\n↳ Actor is overridden by command ('$_command')" 35 27 skip_resolving=1 36 28 fi 37 29 38 30 # NOTE: Speeds things up a little if the command doesn't need actor resolving 39 - if [[ $_command == "at:"* ]] ||\ 40 - [[ $_command == "atfile:"* ]] ||\ 41 - [[ $_command == "bsky" ]] ||\ 42 - [[ $_command == "handle" ]] ||\ 43 - [[ $_command == "now" ]] ||\ 44 - [[ $_command == "release" ]] ||\ 45 - [[ $_command == "resolve" ]] ||\ 46 - [[ $_command == "scrape" ]] ||\ 47 - [[ $_command == "something-broke" ]] ||\ 48 - [[ $_command == "stream" ]]; then 31 + if [[ $_command == "bsky" ]] ||\ 32 + [[ $_command == "handle" ]] ||\ 33 + [[ $_command == "help" ]] ||\ 34 + [[ $_command == "now" ]] ||\ 35 + [[ $_command == "release" ]] ||\ 36 + [[ $_command == "resolve" ]] ||\ 37 + [[ $_command == "scrape" ]] ||\ 38 + [[ $_command == "something-broke" ]] ||\ 39 + [[ $_command == "stream" ]] ||\ 40 + [[ $_command == "update" ]] ||\ 41 + [[ $_command == "version" ]]; then 49 42 atfile.say.debug "Skipping identity resolving\n↳ Not required for command '$_command'" 50 43 skip_resolving=1 51 44 fi
-1
src/commands/help.sh
··· 208 208 usage+="$usage_paths\n" 209 209 210 210 if [[ $_debug == 1 ]]; then 211 - atfile.say.debug "Printing help..." 212 211 echo -e "$usage" 213 212 else 214 213 echo -e "$usage" | less
+5
src/commands/install.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + function atfile.install() { 4 + atfile.die "Not implemented" 5 + }
+32 -210
src/entry.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 - # Entry 4 - 5 - ## Global variables 3 + # Global variables 6 4 7 - ### General 5 + ## General 8 6 9 7 _start="$(atfile.util.get_date "" "%s")" 10 8 _command="$1" 11 - _command_full="$*" 9 + _command_args=("${@:2}") 12 10 _envvar_prefix="ATFILE" 13 11 _os="$(atfile.util.get_os)" 14 12 _is_git=0 ··· 20 18 _now="$(atfile.util.get_date)" 21 19 _version="{:version:}" 22 20 23 - ### Reflection 21 + ## Reflection 24 22 25 23 _prog="$(basename "$(atfile.util.get_realpath "$0")")" 26 24 _prog_dir="$(dirname "$(atfile.util.get_realpath "$0")")" 27 25 _prog_path="$(atfile.util.get_realpath "$0")" 28 26 29 - ### Paths 27 + ## Paths 30 28 31 29 _path_home="$HOME" 32 30 ··· 63 61 _path_cache="$_path_cache/atfile" 64 62 _path_envvar="$(atfile.util.get_envvar "${_envvar_prefix}_PATH_CONF" "$_path_envvar/$_file_envvar")" 65 63 66 - ### Envvars 64 + ## Envvars 67 65 68 - #### Fallbacks 66 + ### Fallbacks 69 67 70 68 _endpoint_appview_fallback="https://api.bsky.app" 71 69 _endpoint_jetstream_fallback="$(atfile.util.get_random_pbc_jetstream)" 72 70 _endpoint_plc_directory_fallback="https://plc.directory" 73 71 _max_list_fallback=100 74 72 75 - #### Defaults 73 + ### Defaults 76 74 77 75 _debug_default=$([[ $ATFILE_DEVEL == 1 ]] && echo 1 || echo 0) 78 76 _devel_publish_default=0 ··· 101 99 _skip_ni_mediainfo_default=0 102 100 _skip_unsupported_os_warn_default=0 103 101 104 - #### Set 102 + ### Set 105 103 106 104 _debug="$(atfile.util.get_envvar "${_envvar_prefix}_DEBUG" "$_debug_default")" 107 105 _devel_publish="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_PUBLISH" $_devel_publish_default)" ··· 138 136 _test_desktop_uas="Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" 139 137 _username="$(atfile.util.get_envvar "${_envvar_prefix}_USERNAME")" 140 138 141 - ### Read-only 139 + ## Read-only 142 140 143 141 _nsid_prefix="blue.zio" 144 142 _nsid_lock="${_nsid_prefix}.atfile.lock" ··· 150 148 "https://deer.social") _endpoint_social_app_name="Deer" ;; 151 149 esac 152 150 153 - ## "Hello, world!" 151 + # Setup 154 152 155 153 atfile.say.debug "Starting up..." 156 154 ··· 249 247 atfile.util.check_prog "jq" "$_prog_hint_jq" 250 248 [[ $_skip_ni_md5sum == 0 ]] && atfile.util.check_prog "md5sum" "" "${_envvar_prefix}_SKIP_NI_MD5SUM" 251 249 252 - ## Lifecycle commands 253 - 254 - if [[ $_is_sourced == 0 ]] && [[ $_command == "" || $_command == "help" || $_command == "h" || $_command == "--help" || $_command == "-h" ]]; then 255 - atfile.help 256 - 257 - atfile.util.print_seconds_since_start_debug 258 - exit 0 259 - fi 260 - 261 - if [[ $_command == "update" ]]; then 262 - atfile.update install 263 - 264 - atfile.util.print_seconds_since_start_debug 265 - exit 0 266 - fi 267 - 268 - if [[ $_command == "version" || $_command == "--version" ]]; then 269 - echo -e "$_version" 270 - 271 - atfile.cache.del "update-check" 272 - atfile.update check-only 273 - atfile.util.print_seconds_since_start_debug 274 - exit 0 275 - fi 250 + # Main 276 251 277 252 ## Command aliases 278 253 279 254 if [[ $_is_sourced == 0 ]]; then 255 + previous_command="$_command" 256 + 280 257 case "$_command" in 281 258 "open"|"print"|"c") _command="cat" ;; 282 259 "rm") _command="delete" ;; 283 260 "download"|"f"|"d") _command="fetch" ;; 284 261 "download-crypt"|"fc"|"dc") _command="fetch-crypt" ;; 285 262 "at") _command="handle" ;; 263 + "--help"|"-h") _command="help" ;; 286 264 "get"|"i") _command="info" ;; 287 265 "ls") _command="list" ;; 288 266 "build") _command="release" ;; ··· 292 270 "ul"|"u") _command="upload" ;; 293 271 "ub") _command="upload-blob" ;; 294 272 "uc") _command="upload-crypt" ;; 273 + "--update"|"-U") _command="update" ;; 295 274 "get-url"|"b") _command="url" ;; 275 + "--version"|"-V") _command="version" ;; 296 276 esac 277 + 278 + if [[ $previous_command != "$_command" ]]; then 279 + atfile.say.debug "Using command '$_command' for '$previous_command'..." 280 + fi 297 281 fi 298 282 299 - ## Authentication 283 + ## Default 300 284 301 - atfile.auth 302 - 303 - ## Protocol handling 285 + if [[ $_is_sourced == 0 && -z $_command ]]; then 286 + atfile.util.override_command "help" 287 + fi 304 288 305 289 if [[ "$_command" == "atfile:"* || "$_command" == "at:"* || "$_command" == "https:"* ]]; then 306 - set -- "handle" "$_command" 307 - _command="handle" 290 + atfile.util.override_command "handle" "$_command" 291 + atfile.say.debug "Handling '${_command_args[*]}'..." 308 292 fi 309 293 310 - ## Commands 311 - 312 - if [[ $_is_sourced == 0 ]] && [[ $ATFILE_DEVEL_NO_INVOKE != 1 ]]; then 313 - atfile.say.debug "Running '$_command_full'...\n↳ Command: $_command\n↳ Arguments: ${*:2}" 314 - 315 - case "$_command" in 316 - "ai") 317 - atfile.ai 318 - ;; 319 - "blob") 320 - case "$2" in 321 - "list"|"ls"|"l") atfile.invoke.blob_list "$3" ;; 322 - "upload"|"u") atfile.invoke.blob_upload "$3" ;; 323 - *) atfile.die.unknown_command "$(echo "$_command $2" | xargs)" ;; 324 - esac 325 - ;; 326 - "bsky") 327 - if [[ -z "$2" ]]; then 328 - atfile.util.override_actor "$_username" 329 - atfile.bsky_profile "$_username" 330 - else 331 - atfile.bsky_profile "$2" 332 - fi 333 - ;; 334 - "cat") 335 - [[ -z "$2" ]] && atfile.die "<key> not set" 336 - if [[ -n "$3" ]]; then 337 - atfile.util.override_actor "$3" 338 - fi 339 - 340 - atfile.invoke.print "$2" 341 - ;; 342 - "delete") 343 - [[ -z "$2" ]] && atfile.die "<key> not set" 344 - atfile.invoke.delete "$2" 345 - ;; 346 - "fetch") 347 - [[ -z "$2" ]] && atfile.die "<key> not set" 348 - if [[ -n "$3" ]]; then 349 - atfile.util.override_actor "$3" 350 - fi 351 - 352 - atfile.invoke.download "$2" 353 - ;; 354 - "fetch-crypt") 355 - atfile.util.check_prog_gpg 356 - [[ -z "$2" ]] && atfile.die "<key> not set" 357 - if [[ -n "$3" ]]; then 358 - atfile.util.override_actor "$3" 359 - fi 360 - 361 - atfile.invoke.download "$2" 1 362 - ;; 363 - "handle") 364 - uri="$2" 365 - protocol="$(atfile.util.get_uri_segment "$uri" protocol)" 294 + ## Auth 366 295 367 - if [[ $protocol == "https" ]]; then 368 - http_uri="$uri" 369 - uri="$(atfile.util.map_http_to_at "$http_uri")" 296 + atfile.auth 370 297 371 - atfile.say.debug "Mapping '$http_uri'..." 372 - 373 - if [[ -z "$uri" ]]; then 374 - atfile.die "Unable to map '$http_uri' to at:// URI" 375 - else 376 - protocol="$(atfile.util.get_uri_segment "$uri" protocol)" 377 - fi 378 - fi 298 + ## Invoke 379 299 380 - atfile.say.debug "Handling protocol '$protocol://'..." 381 - 382 - case $protocol in 383 - "at") atfile.invoke.handle_aturi "$uri" ;; 384 - "atfile") atfile.invoke.handle_atfile "$uri" "$3" ;; 385 - esac 386 - ;; 387 - "info") 388 - [[ -z "$2" ]] && atfile.die "<key> not set" 389 - if [[ -n "$3" ]]; then 390 - atfile.util.override_actor "$3" 391 - fi 392 - 393 - atfile.invoke.get "$2" 394 - ;; 395 - "list") 396 - if [[ "$2" == *.* || "$2" == did:* ]]; then 397 - # NOTE: User has entered <actor> in the wrong place, so we'll fix it 398 - # for them 399 - # BUG: Keys with periods in them can't be used as a cursor 400 - 401 - atfile.util.override_actor "$2" 402 - 403 - atfile.invoke.list "$3" 404 - else 405 - if [[ -n "$3" ]]; then 406 - atfile.util.override_actor "$3" 407 - fi 408 - atfile.invoke.list "$2" 409 - fi 410 - ;; 411 - "lock") 412 - atfile.invoke.lock "$2" 1 413 - ;; 414 - "now") 415 - atfile.now "$2" 416 - ;; 417 - "record") 418 - # NOTE: Performs no validation (apart from JSON)! Here be dragons 419 - case "$2" in 420 - "add"|"create"|"c") atfile.record "create" "$3" "$4" ;; 421 - "get"|"g") atfile.record "get" "$3" ;; 422 - "ls"|"list"|"l") atfile.record_list "$3" ;; 423 - "put"|"update"|"u") atfile.record "update" "$3" "$4" ;; 424 - "rc"|"recreate"|"r") atfile.record "recreate" "$3" "$4" ;; 425 - "rm"|"delete"|"d") atfile.record "delete" "$3" ;; 426 - *) atfile.die.unknown_command "$(echo "$_command $2" | xargs)" ;; 427 - esac 428 - ;; 429 - "release") 430 - if [[ $ATFILE_DEVEL == 1 ]]; then 431 - atfile.release 432 - else 433 - atfile.die.unknown_command "$_command" 434 - fi 435 - ;; 436 - "resolve") 437 - atfile.resolve "$2" 438 - ;; 439 - "something-broke") 440 - atfile.something_broke 441 - ;; 442 - "stream") 443 - atfile.stream "$2" "$3" "$4" "$5" 444 - ;; 445 - "token") 446 - atfile.invoke.token 447 - ;; 448 - "toggle-mime") 449 - atfile.invoke.toggle_desktop 450 - ;; 451 - "upload") 452 - atfile.util.check_prog_optional_metadata 453 - [[ -z "$2" ]] && atfile.die "<file> not set" 454 - atfile.invoke.upload "$2" "" "$3" 455 - ;; 456 - "upload-crypt") 457 - atfile.util.check_prog_optional_metadata 458 - atfile.util.check_prog_gpg 459 - [[ -z "$2" ]] && atfile.die "<file> not set" 460 - [[ -z "$3" ]] && atfile.die "<recipient> not set" 461 - atfile.invoke.upload "$2" "$3" "$4" 462 - ;; 463 - "unlock") 464 - atfile.invoke.lock "$2" 0 465 - ;; 466 - "url") 467 - [[ -z "$2" ]] && atfile.die "<key> not set" 468 - if [[ -n "$3" ]]; then 469 - atfile.util.override_actor "$3" 470 - fi 471 - 472 - atfile.invoke.get_url "$2" 473 - ;; 474 - *) 475 - atfile.die.unknown_command "$_command" 476 - ;; 477 - esac 478 - 479 - atfile.update check-only 300 + if [[ $_is_sourced == 0 ]]; then 301 + atfile.invoke "$_command" "${_command_args[@]}" 480 302 fi 481 303 482 304 atfile.util.print_seconds_since_start_debug
+191
src/shared/invoke.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + function atfile.invoke() { 4 + command="$1" 5 + shift 6 + args=("$@") 7 + 8 + if [[ $_is_sourced == 0 ]] && [[ $ATFILE_DEVEL_NO_INVOKE != 1 ]]; then 9 + atfile.say.debug "Invoking '$command'...\n↳ Arguments: ${args[*]}" 10 + 11 + case "$command" in 12 + "ai") 13 + atfile.ai 14 + ;; 15 + "blob") 16 + case "${args[0]}" in 17 + "list"|"ls"|"l") atfile.invoke.blob_list "${args[1]}" ;; 18 + "upload"|"u") atfile.invoke.blob_upload "${args[1]}" ;; 19 + *) atfile.die.unknown_command "$(echo "$command ${args[0]}" | xargs)" ;; 20 + esac 21 + ;; 22 + "bsky") 23 + if [[ -z "${args[0]}" ]]; then 24 + atfile.util.override_actor "$_username" 25 + atfile.bsky_profile "$_username" 26 + else 27 + atfile.bsky_profile "${args[0]}" 28 + fi 29 + ;; 30 + "cat") 31 + [[ -z "${args[0]}" ]] && atfile.die "<key> not set" 32 + if [[ -n "${args[1]}" ]]; then 33 + atfile.util.override_actor "${args[1]}" 34 + fi 35 + 36 + atfile.invoke.print "${args[0]}" 37 + ;; 38 + "delete") 39 + [[ -z "${args[0]}" ]] && atfile.die "<key> not set" 40 + atfile.invoke.delete "${args[0]}" 41 + ;; 42 + "fetch") 43 + [[ -z "${args[0]}" ]] && atfile.die "<key> not set" 44 + if [[ -n "${args[1]}" ]]; then 45 + atfile.util.override_actor "${args[1]}" 46 + fi 47 + 48 + atfile.invoke.download "${args[0]}" 49 + ;; 50 + "fetch-crypt") 51 + atfile.util.check_prog_gpg 52 + [[ -z "${args[0]}" ]] && atfile.die "<key> not set" 53 + if [[ -n "${args[1]}" ]]; then 54 + atfile.util.override_actor "${args[1]}" 55 + fi 56 + 57 + atfile.invoke.download "${args[0]}" 1 58 + ;; 59 + "handle") 60 + uri="${args[0]}" 61 + protocol="$(atfile.util.get_uri_segment "$uri" protocol)" 62 + 63 + if [[ $protocol == "https" ]]; then 64 + http_uri="$uri" 65 + uri="$(atfile.util.map_http_to_at "$http_uri")" 66 + 67 + atfile.say.debug "Mapping '$http_uri'..." 68 + 69 + if [[ -z "$uri" ]]; then 70 + atfile.die "Unable to map '$http_uri' to at:// URI" 71 + else 72 + protocol="$(atfile.util.get_uri_segment "$uri" protocol)" 73 + fi 74 + fi 75 + 76 + atfile.say.debug "Handling protocol '$protocol://'..." 77 + 78 + case $protocol in 79 + "at") atfile.invoke.handle_aturi "$uri" ;; 80 + "atfile") atfile.invoke.handle_atfile "$uri" "${args[1]}" ;; 81 + esac 82 + ;; 83 + "help") 84 + atfile.help 85 + ;; 86 + "info") 87 + [[ -z "${args[0]}" ]] && atfile.die "<key> not set" 88 + if [[ -n "${args[1]}" ]]; then 89 + atfile.util.override_actor "${args[1]}" 90 + fi 91 + 92 + atfile.invoke.get "${args[0]}" 93 + ;; 94 + "install") 95 + atfile.install 96 + ;; 97 + "list") 98 + if [[ "${args[0]}" == *.* || "${args[0]}" == did:* ]]; then 99 + # NOTE: User has entered <actor> in the wrong place, so we'll fix it 100 + # for them 101 + # BUG: Keys with periods in them can't be used as a cursor 102 + 103 + atfile.util.override_actor "${args[0]}" 104 + 105 + atfile.invoke.list "${args[1]}" 106 + else 107 + if [[ -n "${args[1]}" ]]; then 108 + atfile.util.override_actor "${args[1]}" 109 + fi 110 + atfile.invoke.list "${args[0]}" 111 + fi 112 + ;; 113 + "lock") 114 + atfile.invoke.lock "${args[0]}" 1 115 + ;; 116 + "now") 117 + atfile.now "${args[0]}" 118 + ;; 119 + "record") 120 + # NOTE: Performs no validation (apart from JSON)! Here be dragons 121 + case "${args[0]}" in 122 + "add"|"create"|"c") atfile.record "create" "${args[1]}" "${args[2]}" ;; 123 + "get"|"g") atfile.record "get" "${args[1]}" ;; 124 + "ls"|"list"|"l") atfile.record_list "${args[1]}" ;; 125 + "put"|"update"|"u") atfile.record "update" "${args[1]}" "${args[2]}" ;; 126 + "rc"|"recreate"|"r") atfile.record "recreate" "${args[1]}" "${args[2]}" ;; 127 + "rm"|"delete"|"d") atfile.record "delete" "${args[1]}" ;; 128 + *) atfile.die.unknown_command "$(echo "$command ${args[0]}" | xargs)" ;; 129 + esac 130 + ;; 131 + "release") 132 + if [[ $ATFILE_DEVEL == 1 ]]; then 133 + atfile.release 134 + else 135 + atfile.die.unknown_command "$command" 136 + fi 137 + ;; 138 + "resolve") 139 + atfile.resolve "${args[0]}" 140 + ;; 141 + "something-broke") 142 + atfile.something_broke 143 + ;; 144 + "stream") 145 + atfile.stream "${args[0]}" "${args[1]}" "${args[2]}" "${args[3]}" 146 + ;; 147 + "token") 148 + atfile.invoke.token 149 + ;; 150 + "toggle-mime") 151 + atfile.invoke.toggle_desktop 152 + ;; 153 + "upload") 154 + atfile.util.check_prog_optional_metadata 155 + [[ -z "${args[0]}" ]] && atfile.die "<file> not set" 156 + atfile.invoke.upload "${args[0]}" "" "${args[1]}" 157 + ;; 158 + "upload-crypt") 159 + atfile.util.check_prog_optional_metadata 160 + atfile.util.check_prog_gpg 161 + [[ -z "${args[0]}" ]] && atfile.die "<file> not set" 162 + [[ -z "${args[1]}" ]] && atfile.die "<recipient> not set" 163 + atfile.invoke.upload "${args[0]}" "${args[1]}" "${args[2]}" 164 + ;; 165 + "unlock") 166 + atfile.invoke.lock "${args[0]}" 0 167 + ;; 168 + "update") 169 + atfile.update install 170 + ;; 171 + "url") 172 + [[ -z "${args[0]}" ]] && atfile.die "<key> not set" 173 + if [[ -n "${args[1]}" ]]; then 174 + atfile.util.override_actor "${args[1]}" 175 + fi 176 + 177 + atfile.invoke.get_url "${args[0]}" 178 + ;; 179 + "version") 180 + echo -e "$_version" 181 + atfile.cache.del "update-check" 182 + atfile.update check-only 183 + ;; 184 + *) 185 + atfile.die.unknown_command "$command" 186 + ;; 187 + esac 188 + 189 + atfile.update check-only 190 + fi 191 + }
+7 -1
src/shared/util.sh
··· 72 72 function atfile.util.create_dir() { 73 73 dir="$1" 74 74 75 - atfile.say.debug "Creating directory: $dir" 75 + atfile.say.debug "Creating directory '$dir'..." 76 76 77 77 if ! [[ -d $dir ]]; then 78 78 mkdir -p "$dir" ··· 981 981 fi 982 982 983 983 atfile.say.debug "Overridden identity\n↳ DID: $_username\n↳ PDS: $_server\n↳ Blob URL: $_fmt_blob_url" 984 + } 985 + 986 + function atfile.util.override_command() { 987 + _command="$1" 988 + _command_args=("${@:2}") 989 + atfile.say.debug "Overridden command\n↳ Command: $_command\n↳ Arguments: ${_command_args[*]}" 984 990 } 985 991 986 992 # NOTE: This is to help during sourcing if atfile.uitl.override_actor() has