episoda 0.2.63 → 0.2.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon/daemon-process.js +51 -43
- package/dist/daemon/daemon-process.js.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3729,11 +3729,12 @@ async function findProjectRoot(startPath) {
|
|
|
3729
3729
|
|
|
3730
3730
|
// src/api/machine-settings.ts
|
|
3731
3731
|
async function fetchProjectPath(config, projectId) {
|
|
3732
|
-
|
|
3732
|
+
const machineUuid = config.machine_uuid || config.device_id;
|
|
3733
|
+
if (!machineUuid || !config.access_token) {
|
|
3733
3734
|
return null;
|
|
3734
3735
|
}
|
|
3735
3736
|
const serverUrl = config.api_url || "https://episoda.dev";
|
|
3736
|
-
const url = `${serverUrl}/api/dev/machines/${
|
|
3737
|
+
const url = `${serverUrl}/api/dev/machines/${machineUuid}/project-path/${projectId}`;
|
|
3737
3738
|
try {
|
|
3738
3739
|
const response = await fetch(url, {
|
|
3739
3740
|
method: "GET",
|
|
@@ -3757,11 +3758,12 @@ async function fetchProjectPath(config, projectId) {
|
|
|
3757
3758
|
}
|
|
3758
3759
|
}
|
|
3759
3760
|
async function syncProjectPath(config, projectId, path16) {
|
|
3760
|
-
|
|
3761
|
+
const machineUuid = config.machine_uuid || config.device_id;
|
|
3762
|
+
if (!machineUuid || !config.access_token) {
|
|
3761
3763
|
return false;
|
|
3762
3764
|
}
|
|
3763
3765
|
const serverUrl = config.api_url || "https://episoda.dev";
|
|
3764
|
-
const url = `${serverUrl}/api/dev/machines/${
|
|
3766
|
+
const url = `${serverUrl}/api/dev/machines/${machineUuid}/project-path/${projectId}`;
|
|
3765
3767
|
try {
|
|
3766
3768
|
const response = await fetch(url, {
|
|
3767
3769
|
method: "PUT",
|
|
@@ -3877,14 +3879,20 @@ async function daemonCommand(options = {}) {
|
|
|
3877
3879
|
syncProjectPath(config, config.project_id, projectPath).catch(() => {
|
|
3878
3880
|
});
|
|
3879
3881
|
}
|
|
3880
|
-
const
|
|
3881
|
-
if (!
|
|
3882
|
+
const episodaProjectRoot = await findProjectRoot(projectPath);
|
|
3883
|
+
if (!episodaProjectRoot) {
|
|
3882
3884
|
status.error("Not an Episoda project.");
|
|
3883
3885
|
status.info("");
|
|
3884
3886
|
status.info("Use `episoda clone {workspace}/{project}` to set up a project.");
|
|
3885
3887
|
status.info("");
|
|
3886
3888
|
process.exit(1);
|
|
3887
3889
|
}
|
|
3890
|
+
projectPath = episodaProjectRoot;
|
|
3891
|
+
const isWorktree = await isWorktreeProject(projectPath);
|
|
3892
|
+
if (!isWorktree) {
|
|
3893
|
+
status.error("Invalid Episoda project configuration.");
|
|
3894
|
+
process.exit(1);
|
|
3895
|
+
}
|
|
3888
3896
|
const bareRepoPath = path5.join(projectPath, ".bare");
|
|
3889
3897
|
const scriptsExtracted = await extractBootstrapScripts(bareRepoPath, projectPath);
|
|
3890
3898
|
if (scriptsExtracted) {
|