mirror of
https://github.com/felixrieseberg/macintosh.js.git
synced 2024-07-05 20:29:04 +00:00
fix: If you can't rename, copy
This commit is contained in:
parent
9cd62be64d
commit
e5c008887b
@ -36,7 +36,12 @@ function getUserDataDiskImage() {
|
|||||||
|
|
||||||
// If there's a disk image, move it over
|
// If there's a disk image, move it over
|
||||||
if (!fs.existsSync(diskImageUserPath)) {
|
if (!fs.existsSync(diskImageUserPath)) {
|
||||||
fs.renameSync(diskImagePath, diskImageUserPath);
|
try {
|
||||||
|
fs.renameSync(diskImagePath, diskImageUserPath);
|
||||||
|
} catch (error) {
|
||||||
|
// This is _probably_ a permissions thing, let's copy the file
|
||||||
|
fs.copyFileSync(diskImagePath, diskImageUserPath);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`getUserDataDiskImage: Image in user data dir, not doing anything`
|
`getUserDataDiskImage: Image in user data dir, not doing anything`
|
||||||
|
Loading…
Reference in New Issue
Block a user