tangled
alpha
login
or
join now
zio.sh
/
atfile
37
fork
atom
๐ฆโ๐ฆ Store and retrieve files on the Atmosphere
37
fork
atom
overview
issues
3
pulls
pipelines
get social app name programmatically
ducky.ws
1 month ago
ce310c76
226e3498
1/1
build.yaml
success
19s
+13
-11
2 changed files
expand all
collapse all
unified
split
src
entry.sh
shared
util.sh
+3
-11
src/entry.sh
reviewed
···
248
248
_version="$_force_version" &&\
249
249
atfile.util.print_override_envvar_debug "Version" "_version"
250
250
251
251
-
if [[ $_endpoint_appview != "$_endpoint_appview_default" ]] &&\
252
252
-
[[ $_endpoint_social_app == "$_endpoint_social_app_default" ]]; then
253
253
-
case "$_endpoint_appview" in
254
254
-
"https://bsky.zeppelin.social") _endpoint_social_app="https://zeppelin.social" ;;
255
255
-
esac
251
251
+
if [[ $_endpoint_social_app != "$_endpoint_social_app_default" ]]; then
252
252
+
_endpoint_social_app_name="$(atfile.util.get_root_domain "$_endpoint_social_app")"
253
253
+
_endpoint_social_app_name="${_endpoint_social_app_name^}"
256
254
fi
257
257
-
258
258
-
case "$_endpoint_social_app" in
259
259
-
"https://blacksky.community") _endpoint_social_app_name="Blacksky" ;;
260
260
-
"https://deer.social") _endpoint_social_app_name="Deer" ;;
261
261
-
"https://zeppelin.social") _endpoint_social_app_name="Zeppelin" ;;
262
262
-
esac
263
255
264
256
### Validation
265
257
+10
src/shared/util.sh
reviewed
···
424
424
echo -e "$input" | sed -n "$(( index ))"p
425
425
}
426
426
427
427
+
function atfile.util.get_root_domain() {
428
428
+
local url="$1"
429
429
+
local domain=${url#*://}
430
430
+
domain=${domain%%/*}
431
431
+
432
432
+
local main_part=$(echo "$domain" | tr '.' '\n' | tac | sed -n '2p')
433
433
+
434
434
+
echo "$main_part"
435
435
+
}
436
436
+
427
437
function atfile.util.get_mediainfo_field() {
428
438
file="$1"
429
439
category="$2"