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

Configure Feed

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

[#5] issue/5-macos-stat โž” dev

Ducky 6b46cd45 95af2aa6

+17 -2
+17 -2
atfile.sh
··· 484 484 fi 485 485 } 486 486 487 + function atfile.util.get_os() { 488 + case $OSTYPE in 489 + "darwin") echo "macos" ;; 490 + "linux-gnu") echo "linux" ;; 491 + *) echo "unknown-$OSTYPE" ;; 492 + esac 493 + } 494 + 487 495 function atfile.util.get_rkey_from_at_uri() { 488 496 at_uri="$1" 489 497 echo $at_uri | cut -d "/" -f 5 ··· 1785 1793 fi 1786 1794 1787 1795 if [[ $success == 1 ]]; then 1788 - file_date="$(atfile.util.get_date "$(stat -c '%y' "$file")")" 1796 + unset file_date 1797 + 1798 + if [[ $(atfile.util.get_os) == "macos" ]]; then 1799 + file_date="$(atfile.util.get_date "$(stat -f '%Sm' "$file")")" 1800 + else 1801 + file_date="$(atfile.util.get_date "$(stat -c '%y' "$file")")" 1802 + fi 1803 + 1789 1804 file_hash="$(atfile.util.get_md5 "$file")" 1790 1805 file_hash_type="md5" 1791 1806 file_name="$(basename "$file")" 1792 1807 file_size="$(wc -c "$file" | cut -d " " -f 1)" 1793 1808 file_type="$(file -b --mime-type "$file")" 1794 - 1809 + 1795 1810 if [[ -z "$file_hash" ]]; then 1796 1811 file_hash_type="none" 1797 1812 fi