-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP symlink, net_device virtio, move fixes, upload binary fixes
- Loading branch information
1 parent
13248a9
commit 891e799
Showing
6 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import getAbsolutePathForApp from '../utils/getAbsolutePathForApp.js'; | ||
import pathLib from '../../../lib/path.js'; | ||
|
||
// This only works for absolute symlinks for now | ||
const symlink = async function (target, linkPath) { | ||
|
||
|
||
// If auth token is not provided and we are in the web environment, | ||
// try to authenticate with Puter | ||
if(!puter.authToken && puter.env === 'web'){ | ||
try{ | ||
await puter.ui.authenticateWithPuter(); | ||
}catch(e){ | ||
// if authentication fails, throw an error | ||
throw 'Authentication failed.'; | ||
} | ||
} | ||
|
||
// convert path to absolute path | ||
linkPath = getAbsolutePathForApp(linkPath); | ||
target = getAbsolutePathForApp(target); | ||
const name = pathLib.basename(linkPath); | ||
const linkDir = pathLib.dirname(linkPath) | ||
|
||
const op = | ||
{ | ||
op: 'symlink', | ||
path: linkDir, | ||
name: name, | ||
target: target | ||
}; | ||
|
||
const formData = new FormData(); | ||
formData.append('operation', JSON.stringify(op)); | ||
|
||
try { | ||
const response = await fetch(this.APIOrigin + "/batch", { | ||
method: 'POST', | ||
headers: { 'Authorization': `Bearer ${puter.authToken}` }, | ||
body: formData | ||
}); | ||
if (response.status !== 200) { | ||
const error = await response.text(); | ||
console.error("[symlink] fetch error: ", error); | ||
throw error; | ||
} | ||
} catch (e) { | ||
console.error("[symlink] fetch error: ", e); | ||
throw e; | ||
} | ||
|
||
|
||
} | ||
|
||
export default symlink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule v86
updated
10 files
+1 −1 | Makefile | |
+1 −1 | debug.html | |
+106 −56 | index.html | |
+143 −83 | lib/9p-puter.js | |
+194 −38 | src/browser/main.js | |
+5 −1 | src/cpu.js | |
+1 −0 | src/lib.js | |
+98 −93 | src/rust/cpu/cpu.rs | |
+1 −2 | src/vga.js | |
+74 −11 | v86.css |