Skip to content

Conversation

@supertobi
Copy link
Contributor

Could be improved, but at least it works for me.

@supertobi
Copy link
Contributor Author

@wpferguson Please test and merge if OK.

@wpferguson
Copy link
Member

I'll build a test suite for this and the other PR. Should have it done tonight.

if dtutils_file.check_if_bin_exists("cp") then
if dt.configuration.running_os == "windows" then
os.execute('copy "' .. fromFile .. '" "' .. toFile .. '"')
result = true
Copy link
Member

Choose a reason for hiding this comment

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

this should be result = os.execute also. It returns nil on failure and true on success, so we can use the windows copy command and if it fails for some reason then fall back to the pure lua copy solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@supertobi supertobi merged commit 0fe95e9 into master Apr 16, 2019
@supertobi supertobi deleted the file.lua branch April 16, 2019 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants