Skip to content

Commit d31ddfe

Browse files
Now strips read only flags when copying file to project from game dump
1 parent 8b37916 commit d31ddfe

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

docs/release-notes/0.0.2-beta.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- Select an active project to quick add files to
1111
- Font viewer
1212
- Set project root
13-
- Full export support in various formats (Textures, Models (untested))
13+
- Full export support in various formats (Supported file types only)
1414

1515
# TKMM Integration
1616
- TKMM option support

src/addToProject.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ export async function addDumpEntryToProject(
7373
try {
7474
await ensureParentDirectory(copyPaths.destination);
7575
await fs.promises.copyFile(copyPaths.source, copyPaths.destination);
76+
try {
77+
await fs.promises.chmod(copyPaths.destination, 0o666);
78+
} catch (e) {
79+
// Ignore chmod errors
80+
}
7681
if (!options?.suppressSuccessMessage) {
7782
void vscode.window.showInformationMessage(
7883
`Added to project: ${path.relative(normalizePath(projectRoot), copyPaths.destination)}`,

src/archiveFsCommands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ async function copyEntries(
344344
toFileUri(target),
345345
{ overwrite: false },
346346
);
347+
try {
348+
await fs.promises.chmod(target.fsPath, 0o666);
349+
} catch (e) {
350+
// Ignore chmod errors
351+
}
347352
} else {
348353
const stat = await vscode.workspace.fs.stat(source.resourceUri);
349354
const isDirectory = stat.type === vscode.FileType.Directory && !isArchiveFile(source.resourceUri.fsPath);

src/canonicalSavePropagation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ async function ensureArchiveInProject(
168168

169169
await fs.promises.mkdir(path.dirname(projectArchivePath), { recursive: true });
170170
await fs.promises.copyFile(dumpArchivePath, projectArchivePath);
171+
try {
172+
await fs.promises.chmod(projectArchivePath, 0o666);
173+
} catch (e) {
174+
// Ignore chmod errors
175+
}
171176
output.appendLine(`[canonical-save] Copied archive into project: ${projectArchivePath}`);
172177
return { ready: true, copied: true };
173178
}

0 commit comments

Comments
 (0)