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

fix scripts_installer handling user names with spaces on windows #15437

Merged
merged 5 commits into from Oct 18, 2023

Conversation

wpferguson
Copy link
Member

Install the lua scripts on windows when the username has a space in it.

Just for reference the proper way to quote argument strings with spaces for windows is
""\Program Files\darktable\bin\darktable" "\Users\A User\Pictures\img1234.cr2""

@wpferguson wpferguson added bugfix pull request fixing a bug lua scope: windows support windows related issues and PR labels Oct 17, 2023
@TurboGit
Copy link
Member

@wpferguson : Can you rebase on current master? The GitHub-CI issue should be fixed there. TIA.

@TurboGit TurboGit added this to the 4.6 milestone Oct 17, 2023
            is happening when the scripts_installer doesn't work.

            Added a lua preference to turn the debugging messages
            on and off.
            windows by...

            adding the string sanitize functions from the lua scripts
            string library to handle spaces in argument strings.

            wrapping the os.execute() command with an os_execute()
            function that surrounds the command in quotes before sending
            to os.execute() if we are on windows.  This is necessary if
            there is more than one quoted string in the command.
@wpferguson
Copy link
Member Author

@TurboGit how do I do that?

I did git pull --rebase upstream master and that worked, but when I pushed to origin scripts_installer_updates I got

To https://github.com/wpferguson/darktable
 ! [rejected]              scripts_installer_updates -> scripts_installer_updates (non-fast-forward)
error: failed to push some refs to 'https://github.com/wpferguson/darktable'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

@TurboGit
Copy link
Member

You need to force push with option -f.

@wpferguson
Copy link
Member Author

Thanks. That's what I thought but I didn't want to break anything.

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit TurboGit merged commit 72d9ac5 into darktable-org:master Oct 18, 2023
5 checks passed
@manu-p
Copy link

manu-p commented Feb 1, 2024

Hi, FYI it's been reported the same issue on Mac when the username has a space in it.

A workaround might be to replace on line 115 of luarc:
local find_scripts_cmd = _scripts_install.dir_cmd .. CONFIG_DIR
with
local find_scripts_cmd = _scripts_install.dir_cmd .. "\"" .. CONFIG_DIR .. "\""

@wpferguson
Copy link
Member Author

Please open an issue at https://github.com/darktable-org/lua-scripts/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix pull request fixing a bug lua scope: windows support windows related issues and PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants