11// Load .env file
2- import { parse } from "https://deno.land/std@0.224.0/flags/mod .ts" ;
2+ import { parseArgs } from "https://deno.land/std@0.224.0/cli/parse_args .ts" ;
33import {
44 CharmManager ,
55 compileRecipe ,
@@ -9,7 +9,10 @@ import {
99import { getEntityId , isStream } from "@commontools/runner" ;
1010import { Identity } from "@commontools/identity" ;
1111
12- let { space, charmId, recipeFile, cause } = parse ( Deno . args ) ;
12+ const { space, charmId, recipeFile, cause } = parseArgs ( Deno . args , {
13+ string : [ "space" , "charmId" , "recipeFile" , "cause" ] ,
14+ default : { } ,
15+ } ) ;
1316
1417const toolshedUrl = Deno . env . get ( "TOOLSHED_API_URL" ) ??
1518 "https://toolshed.saga-castor.ts.net/" ;
@@ -18,10 +21,10 @@ storage.setRemoteStorage(new URL(toolshedUrl));
1821setBobbyServerUrl ( toolshedUrl ) ;
1922
2023async function main ( ) {
21- console . log ( "params:" , { space, charmId, recipeFile, cause } ) ;
2224 const identity = await Identity . fromPassphrase ( "common-cli" ) ;
25+ console . log ( "params:" , { space, identity, charmId, recipeFile, cause } ) ;
2326 const manager = await CharmManager . open ( {
24- space : space ?? identity . did ( ) ,
27+ space : ( space as `did:key:${ string } ` ) ?? identity . did ( ) ,
2528 signer : identity ,
2629 } ) ;
2730 const charms = await manager . getCharms ( ) ;
0 commit comments