Skip to content

Commit 223f4eb

Browse files
committed
fix: only add main.crdt if the workspace is a DCL project
1 parent eee9b18 commit 223f4eb

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/extension.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,20 @@ export async function activate(context: vscode.ExtensionContext) {
236236
'decentraland/js-sdk-toolchain'
237237
)
238238

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

243-
if (!mainCrdtExists) {
244-
log(
245-
`Could not find the main.crdt file, copying from extension path to workspace path: ${mainCrdtPath}`
246-
)
247-
await vscode.workspace.fs.copy(
248-
vscode.Uri.joinPath(context.extensionUri, 'resources', 'main.crdt'),
249-
vscode.Uri.file(mainCrdtPath)
250-
)
244+
if (!mainCrdtExists) {
245+
log(
246+
`Could not find the main.crdt file, copying from extension path to workspace path: ${mainCrdtPath}`
247+
)
248+
await vscode.workspace.fs.copy(
249+
vscode.Uri.joinPath(context.extensionUri, 'resources', 'main.crdt'),
250+
vscode.Uri.file(mainCrdtPath)
251+
)
252+
}
251253
}
252254

253255
// Start servers and watchers

0 commit comments

Comments
 (0)