|
|
@@ -17,11 +17,7 @@ const FileSearchCommand = cmd({
|
|
|
}),
|
|
|
async handler(args) {
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
- const results = await AppRuntime.runPromise(
|
|
|
- Effect.gen(function* () {
|
|
|
- return yield* File.Service.use((svc) => svc.search({ query: args.query }))
|
|
|
- }),
|
|
|
- )
|
|
|
+ const results = await AppRuntime.runPromise(File.Service.use((svc) => svc.search({ query: args.query })))
|
|
|
process.stdout.write(results.join(EOL) + EOL)
|
|
|
})
|
|
|
},
|
|
|
@@ -38,11 +34,7 @@ const FileReadCommand = cmd({
|
|
|
}),
|
|
|
async handler(args) {
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
- const content = await AppRuntime.runPromise(
|
|
|
- Effect.gen(function* () {
|
|
|
- return yield* File.Service.use((svc) => svc.read(args.path))
|
|
|
- }),
|
|
|
- )
|
|
|
+ const content = await AppRuntime.runPromise(File.Service.use((svc) => svc.read(args.path)))
|
|
|
process.stdout.write(JSON.stringify(content, null, 2) + EOL)
|
|
|
})
|
|
|
},
|
|
|
@@ -54,11 +46,7 @@ const FileStatusCommand = cmd({
|
|
|
builder: (yargs) => yargs,
|
|
|
async handler() {
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
- const status = await AppRuntime.runPromise(
|
|
|
- Effect.gen(function* () {
|
|
|
- return yield* File.Service.use((svc) => svc.status())
|
|
|
- }),
|
|
|
- )
|
|
|
+ const status = await AppRuntime.runPromise(File.Service.use((svc) => svc.status()))
|
|
|
process.stdout.write(JSON.stringify(status, null, 2) + EOL)
|
|
|
})
|
|
|
},
|
|
|
@@ -75,11 +63,7 @@ const FileListCommand = cmd({
|
|
|
}),
|
|
|
async handler(args) {
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
- const files = await AppRuntime.runPromise(
|
|
|
- Effect.gen(function* () {
|
|
|
- return yield* File.Service.use((svc) => svc.list(args.path))
|
|
|
- }),
|
|
|
- )
|
|
|
+ const files = await AppRuntime.runPromise(File.Service.use((svc) => svc.list(args.path)))
|
|
|
process.stdout.write(JSON.stringify(files, null, 2) + EOL)
|
|
|
})
|
|
|
},
|