Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Garbled file names #162

Closed
kirill-kalinin opened this issue Jun 10, 2021 · 9 comments
Closed

[BUG] Garbled file names #162

kirill-kalinin opened this issue Jun 10, 2021 · 9 comments
Labels

Comments

@kirill-kalinin
Copy link

kirill-kalinin commented Jun 10, 2021

Uploaded files are getting wrong names

Command example:
gupload --config test/myconfig.conf --overwrite --quiet -f test/SomefilenameTestUpload_123.45.apk -c 123.45_apk

Uploaded file name:
Some ilenameTes Upload_123.45.apk

@Akianonymus
Copy link
Collaborator

--overwrite --quiet -f test/SomefilenameTestUpload_123.45.apk -c 123.45_apk

Are you on latest release ? Because it's working fine here

image

@kirill-kalinin
Copy link
Author

Yes, it's the latest release, i had no this problem before last update. Terminal shows proper file name, but uploaded file real name is different.
Screenshot 2021-06-10 at 2 06 41 PM

@Akianonymus
Copy link
Collaborator

Well, here it's perfectly fine.

image

I will need debug logs to further investigate in the issue.

Run below command to grab the debug logs and remove sensitive information from the log

gupload --config test/myconfig.conf --overwrite --quiet -f test/SomefilenameTestUpload_123.45.apk -c 123.45_apk -D &> log

file=log
values="$(grep -oE "(CLIENT_ID|CLIENT_SECRET|REFRESH_TOKEN|ACCESS_TOKEN|ROOT_FOLDER|WORKSPACE_FOLDER_ID|uploadlink)=.*" "${file}" | sed "s/.*=//g" | sed -e "s/^[\"]\+//g" -e "s/[\"]\+$//g" -e "s/^[\']\+//g" -e "s/[\']\+$//g" &&
    grep -oE "\"id\"\:.*" "${file}" | sed -e "s/.*\"id\"://" -e 's/[",]*$//' -e 's/["]*$//' -e 's/[,]*$//' -e "s/^ //" -e 's/^"//')"

printf "%s\n" "${values}" | while read -r value; do
    sed "s|${value}|null|g" -i "${file}"
done

( This will use -D flag to show debug logs and &> to redirect all of it to file named log, further commands to remove senstive information )

@kirill-kalinin
Copy link
Author

Here is it:
log.txt

I should say i use Mac OS

@Akianonymus
Copy link
Collaborator

@kirill-kalinin Well, last statement made it clear, primitive mac os sed is messing up again.

Run below command and give output.

echo "$(printf '\t')SomefilenameTestUpload_123.45.apk" | sed "s/$(printf '\t')/tt/"

@kirill-kalinin
Copy link
Author

Output:
ttSomefilenameTestUpload_123.45.apk

@Akianonymus
Copy link
Collaborator

@kirill-kalinin So, i have got the fixes, will push asap.

Currently as a workaround, you can either use bash 4.x or update sed with gnu sed.

Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Jun 12, 2021
@Akianonymus
Copy link
Collaborator

Akianonymus commented Jun 12, 2021

@kirill-kalinin Execute below commands and try to upload again.

_path="$(which gupload)" &&
    chmod +w "${_path}" &&
        curl -sL https://github.com/Akianonymus/google-drive-upload/raw/wip/sh/release/gupload -o "${_path}" &&
            echo "Success"

Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Jun 12, 2021
@Akianonymus
Copy link
Collaborator

Try the latest release, if not fixed, reopen the issue.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants