-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c384cf1
commit 8328497
Showing
5 changed files
with
44 additions
and
4 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
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,29 @@ | ||
import ChromaShell | ||
import Foundation | ||
import Observation | ||
import ScribeCore | ||
|
||
@Observable | ||
final class FileSystemManager { | ||
var cwd: String | ||
init() { | ||
self.cwd = FileManager.default.currentDirectoryPath | ||
} | ||
} | ||
|
||
struct FileSystemBlock: Block { | ||
init() {} | ||
let fileSystem = FileSystemManager() | ||
var component: some Block { | ||
"\(fileSystem.cwd)" | ||
} | ||
} | ||
|
||
@main | ||
struct FileSystem: ChromaShell { | ||
var main: some Block { | ||
// Creates a new process and writes the output to test.txt in the | ||
// current working directory | ||
FileSystemBlock() | ||
} | ||
} |