Closed JoeGermuska closed 1 month ago
Woops, this ain't my issue. Re-opening!
Should be fixed in 0.4.5.
Hello! This is still not fixed. -c
is still used.
Hello! This is still not fixed.
-c
is still used.
Hrm. Could you do echo $OSTYPE
in Bash on macOS for me? Apparently whatever I read to detect macOS doesn't work
$OSTYPE
is currently set to darwin24.0
in Zsh. in Bash, it's darwin24
.
Can I ask by the way, why not just run uname
? on Linux, it'll return Linux
, and on macos it'll return Darwin
. That seems to be all this function is doing 👀
$OSTYPE
is currently set todarwin24.0
in Zsh. in Bash, it'sdarwin24
.Can I ask by the way, why not just run
uname
? on Linux, it'll returnLinux
, and on macos it'll returnDarwin
. That seems to be all this function is doing 👀
It's a bit of futureproofing I had in mind, and I prefer using Bash-isms and built-in variables when I can, even though I imagine $OSTYPE
is built from uname
. If there is any more irritating problems going forward I'll probably drop it in favour of uname
though
To save myself from pushing out a million release, not going to do another release until I'm certain this (and any other macOS woes) is fixed.
Should be fixed in atfile.sh
on 02dd356
I have another (two) macOS woes for you 😄
date
is complaining about some illegal option -
, and realpath
complains about -s
not being an option. the former I suspect some variable isn't being set. would you like me to open another issue for this? or should we choose this thread to be the master macos annoyances thread?
should we choose this thread to be the master macos annoyances thread?
Saw this coming from a mile away, haha. Yeah, we'll keep it here :+1:
Gladly accept PRs too since I'm blindly doing this, and although macOS does generally use BSD tools, from memory of using macOS years ago there was a few disparities
@bdotsamir realpath
and date
handled in 4bb6dc817f6dc9a619f52fc5bda1eb9c5a467f6e.
The next one might be file
, since I can't figure out if macOS has --mime-type
or not
I dont see nvm it was in another commit lol
And I would PR myself but it's hard to follow the code here. I'll see if I can give it a godate
handled in that diff :(
looks like the date
command is receiving the format wrongly:
6 fixes the date parsing on macos at least.. though it still fails to upload. not sure what's causing it this time.
hmm, what happens now?
I'm not sure.. it just fails to upload.
Error: Unable to upload \
I'm not sure.. it just fails to upload. Error: Unable to upload
How large is the file? And could you do atfile something-broke
The file is not large at all, 242 kb.
something-broke:
@bdotsamir In 7c3d928f2703c85c7e1d775000e53fd3805fb512, I've added some more debug checkpoints to see exactly where its going wrong. If you run it with ATFILE_DEBUG=1
, you'll see this output
@electricduck
Hm. Should the size
field be blank?
@bdotsamir
Hm. Should the
size
field be blank?
No, it shouldn't be. That'll be where its going wrong. That is being done with wc -c "<file>" | cut -d " " -f 1
. afaik, wc
has the same params on macOS/BSD... but maybe the output is different
🤓
(no seriously i just needed to change it like so:
- file_size="$(wc -c "$file" | cut -d " " -f 1)"
+ file_size="$(wc -c "$file" | cut -d " " -f 3)"
)
This did not fix the issue though. Uploading a different file type, .mov for example, changes the number we should be putting after -f
in the cut
command. Why? dunno.
iirc awk
is installed everywhere and might have better support for parsing out numbers instead of cutting by space and taking the n
th index
Just replaced the filesize calc with stat
instead of using wc
@electricduck That did it! Not getting any more errors 🥳
These fixes are in 0.4.6
@JoeGermuska Could you update and confirm this works for you too (and close the ticket if it does) :smile:
0.4.6 works for me!
For what it's worth, I tried using this on MacOS Sonoma 14.6.1 and hit an error in
atfile.invoke.upload
because-c
is not a valid flag for the version ofstat
.https://github.com/electricduck/atfile/blob/main/atfile.sh#L1773