diff --git a/package.json b/package.json index 7a7baa7..9409132 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tinystudio", - "version": "0.1.0", + "version": "0.1.1", "description": "An open-source desktop + web IDE for building, wiring, simulating, and flashing tiny hardware projects — code, circuit, and visual views in one place.", "main": "./out/main/index.js", "author": "MR.INDUSTRIES", diff --git a/src/renderer/src/commands/fileCommands.ts b/src/renderer/src/commands/fileCommands.ts index c1a786a..b7d97f4 100644 --- a/src/renderer/src/commands/fileCommands.ts +++ b/src/renderer/src/commands/fileCommands.ts @@ -281,6 +281,22 @@ export class LoadGitHubProjectCommand implements Command { ) } + const name = this.path ? this.path.split('/').pop()! : this.repo + + // Desktop: materialize the project to a real folder so arduino-cli (via + // tinyService) can read it from disk. The in-memory `mem://` path is not a + // real file path and can't be compiled/uploaded. The browser has no disk to + // write to, so it falls back to the virtual workspace (view/edit only; the + // Arduino service guards mem:// compile/upload with a clear message). + if (fileSystem.isElectron()) { + const dir = `${await window.api.app.getExamplesDir()}/${name}` + for (const [rel, content] of Object.entries(files)) { + await fileSystem.writeFile(`${dir}/${rel}`, content) + } + await new OpenWorkspaceCommand(dir).execute() + return + } + const root = `${VIRTUAL_PREFIX}${this.owner}/${this.repo}${this.path ? '/' + this.path : ''}` virtualFileSystem.clear(root) await virtualFileSystem.seed(root, files) @@ -291,7 +307,6 @@ export class LoadGitHubProjectCommand implements Command { const fsItems = await fileSystem.readDirectory(root, true) const fileItems = buildNestedStructure(fsItems) - const name = this.path ? this.path.split('/').pop()! : this.repo const workspace: Workspace = { id: crypto.randomUUID(), name, diff --git a/src/renderer/src/components/StatusBar.tsx b/src/renderer/src/components/StatusBar.tsx index deb05af..8ff98a1 100644 --- a/src/renderer/src/components/StatusBar.tsx +++ b/src/renderer/src/components/StatusBar.tsx @@ -85,7 +85,7 @@ export function StatusBar(): React.JSX.Element {
UTF-8
Arduino (C++)
-tinyStudio 0.1.0 · alpha
+tinyStudio 0.1.1 · alpha