Skip to content

Commit

Permalink
fix: only add main.crdt if the workspace is a DCL project
Browse files Browse the repository at this point in the history
  • Loading branch information
cazala committed May 21, 2024
1 parent eee9b18 commit 223f4eb
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,20 @@ export async function activate(context: vscode.ExtensionContext) {
'decentraland/js-sdk-toolchain'
)

// Add main.crdt if not present
const mainCrdtPath = path.join(getCwd(), 'main.crdt')
const mainCrdtExists = await exists(mainCrdtPath)
// Add main.crdt if not present (only if it is a DCL project)
if (isDCL()) {
const mainCrdtPath = path.join(getCwd(), 'main.crdt')
const mainCrdtExists = await exists(mainCrdtPath)

if (!mainCrdtExists) {
log(
`Could not find the main.crdt file, copying from extension path to workspace path: ${mainCrdtPath}`
)
await vscode.workspace.fs.copy(
vscode.Uri.joinPath(context.extensionUri, 'resources', 'main.crdt'),
vscode.Uri.file(mainCrdtPath)
)
if (!mainCrdtExists) {
log(
`Could not find the main.crdt file, copying from extension path to workspace path: ${mainCrdtPath}`
)
await vscode.workspace.fs.copy(
vscode.Uri.joinPath(context.extensionUri, 'resources', 'main.crdt'),
vscode.Uri.file(mainCrdtPath)
)
}
}

// Start servers and watchers
Expand Down

0 comments on commit 223f4eb

Please sign in to comment.