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

Configure Feed

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

improve support for dates on musl and Solaris

Ducky 3a8139fb 40806409

+6 -4
+6 -4
src/shared/util.sh
··· 190 190 } 191 191 192 192 # TODO: Support BusyBox's shit `date` command 193 - # `date -u +"$format" -s "1996-08-11 01:23:34"`` 193 + # `date -u +"$format" -s "1996-08-11 01:23:34"` 194 194 function atfile.util.get_date() { 195 195 date="$1" 196 196 format="$2" ··· 198 198 199 199 [[ -z $format ]] && format="%Y-%m-%dT%H:%M:%SZ" 200 200 201 - if [[ $_os == "bsd-"* ]]; then 202 - if [[ $date =~ ^([0-9]{4}-[0-9]{2}-[0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3}){0,1})Z$ ]]; then 201 + if [[ $date =~ ^([0-9]{4}-[0-9]{2}-[0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3}){0,1})Z$ ]]; then 202 + if [[ $_os == "bsd-"* ]]; then 203 203 date="${BASH_REMATCH[1]} ${BASH_REMATCH[2]}" 204 204 in_format="%Y-%m-%d %H:%M:%S" 205 + elif [[ $_os == "linux-musl" || $_os == "solaris" ]]; then 206 + date="${BASH_REMATCH[1]} ${BASH_REMATCH[2]}" 205 207 fi 206 208 fi 207 209 ··· 215 217 fi 216 218 else 217 219 if [[ $_os == "linux-musl" || $_os == "solaris" ]]; then 218 - echo "" 220 + date -u -d "$date" 219 221 elif [[ $_os == "bsd-"* || $_os == "macos" ]]; then 220 222 date -u -j -f "$in_format" "$date" +"$format" 221 223 else