šŸ“¦āž”šŸ¦‹ Store and retrieve files on the Atmosphere
35
fork

Configure Feed

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

add atfile-release meta

Ducky 4b0c3094 b50d7ed4

+27 -6
+1
src/commands/install.sh
··· 1 1 #!/usr/bin/env bash 2 + # atfile-release=ignore 2 3 3 4 function atfile.install() { 4 5 override_path="$1"
+26 -6
src/commands/release.sh
··· 1 1 #!/usr/bin/env bash 2 + # atfile-release=ignore 2 3 3 4 function atfile.release() { 4 5 # shellcheck disable=SC2154 5 6 [[ $_os != "linux" ]] && atfile.die "Only available on Linux (GNU)\n↳ Detected OS: $_os" 7 + 8 + function atfile.release.get_devel_value() { 9 + local file="$1" 10 + local value="$2" 11 + local found_line 12 + 13 + found_line="$(grep '^# atfile-release=' "$file" | head -n1)" 14 + if [[ -n "$found_line" ]]; then 15 + local devel_values="${found_line#*=}" 16 + IFS=',' read -ra arr <<< "$devel_values" 17 + for v in "${arr[@]}"; do 18 + if [[ "$v" == "$value" ]]; then 19 + echo 1 20 + fi 21 + done 22 + fi 23 + } 6 24 7 25 function atfile.release.replace_template_var() { 8 26 string="$1" ··· 54 72 55 73 for s in "${ATFILE_DEVEL_INCLUDES[@]}" 56 74 do 57 - if [[ "$s" != *"/src/commands/release.sh" ]]; then 58 - if [[ -f "$s" ]]; then 59 - echo "↳ Adding: $s" 75 + if [[ -f "$s" ]]; then 76 + if [[ $(atfile.release.get_devel_value "$s" "ignore" == 1 ) ]]; then 77 + echo "↳ Ignoring: $s" 78 + else 79 + echo "↳ Compiling: $s" 60 80 61 81 while IFS="" read -r line 62 82 do 63 83 include_line=1 64 84 65 85 if [[ $line == "#"* ]] ||\ 66 - [[ $line == *" #"* ]] ||\ 67 - [[ $line == " " ]] ||\ 68 - [[ $line == "" ]]; then 86 + [[ $line == *" #"* ]] ||\ 87 + [[ $line == " " ]] ||\ 88 + [[ $line == "" ]]; then 69 89 include_line=0 70 90 fi 71 91