📦➔🦋 Store and retrieve files on the ATmosphere
at main 442 B view raw
1#!/usr/bin/env bash 2 3function atfile.cache.del() { 4 key="$(atfile.util.get_cache_path "$1")" 5 [[ -f "$key" ]] && rm "$key" 6} 7 8function atfile.cache.get() { 9 key="$(atfile.util.get_cache_path "$1")" 10 [[ -f "$key" ]] && cat "$key" 11} 12 13function atfile.cache.set() { 14 key="$(atfile.util.get_cache_path "$1")" 15 value="$2" 16 17 # shellcheck disable=SC2154 18 mkdir -p "$_path_cache" 19 echo "$value" > "$key" 20 echo "$value" 21}