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: file moving on Android #164

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/util/move-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ async function moveFile (src, dest) {
// really what we want to do here.
} else if (err.code === 'EEXIST' || err.code === 'EBUSY') {
// file already exists, so whatever
} else if (process.platform === 'android' && err.code === 'EACCES') {
// Android doesn't support hard links, so we get EACCES when trying
// to link.
return move(src, dest)
} else {
throw err
}
Expand Down
6 changes: 5 additions & 1 deletion test/util/move-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ t.test('fallback to renaming on missing files post-move', async t => {
)
})

t.test('non ENOENT error on move fallback', async function (t) {
t.test('non ENOENT error on move fallback', {
skip: process.platform === 'android'
? 'The move fallback is unreachable on Android.'
: false,
}, async function (t) {
const testDir = t.testdir({
src: 'foo',
})
Expand Down