mirror of
https://github.com/felixrieseberg/macintosh.js.git
synced 2024-06-29 11:29:30 +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 (!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 {
|
||||
console.log(
|
||||
`getUserDataDiskImage: Image in user data dir, not doing anything`
|
||||
|
|
Loading…
Reference in New Issue
Block a user