Skip to content

Commit

Permalink
Remove windows read-only flag
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanW3 committed Aug 4, 2024
1 parent 74bd85c commit 9e4be4b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/update-handling/FileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,23 @@ export class FileService {
try {
logger.info(`Copy from: ${from} to: ${to}`);
fse.copySync(from, to);
if (process.platform == "win32")
{
const exec = window.require('child_process').exec;
exec(`attrib -r "${to}\\*" /s`, (error: any, stdout: any, stderr: any) => {
if (error) {
logger.error(`attrib error: ${error.message}`);
return;
}
if (stderr) {
logger.error(`attrib stderr: ${stderr}`);
return;
}
if (stdout) {
logger.info(`attrib stdout: ${stdout}`);
}
});
}
} catch (e) {
logger.info("Copy with sudo now")
this.sudoCopyFromTo(from, to);
Expand Down

0 comments on commit 9e4be4b

Please sign in to comment.