File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 33 "allowJs" : false ,
44 "strict" : true
55 },
6- "pkgx" : " deno^ 2.0" ,
6+ "pkgx" : " deno~ 2.0" ,
77 "tasks" : {
88 "test" : " deno test --parallel --unstable-fs --unstable-ffi --allow-all" ,
99 "typecheck" : " deno check ./mod.ts"
Original file line number Diff line number Diff line change @@ -161,13 +161,18 @@ export async function runtime_env(project: string) {
161161import useCellar from "./useCellar.ts"
162162
163163async function _db ( ) {
164- if ( Deno . build . os == 'windows' ) return
165- const path = useConfig ( ) . cache . join ( 'pantry.db' )
166- if ( ! path . isFile ( ) ) return
167- const sqlite = await useCellar ( ) . has ( { project : "sqlite.org" , constraint : new semver . Range ( '*' ) } )
168- if ( ! sqlite ) return
169- const ext = host ( ) . platform == 'darwin' ? 'dylib' : 'so'
170- return new Database ( path . string , { readonly : true , sqlite3 : sqlite . path . join ( `lib/libsqlite3.${ ext } ` ) . string } )
164+ try {
165+ if ( Deno . build . os == 'windows' ) return
166+ const path = useConfig ( ) . cache . join ( 'pantry.db' )
167+ if ( ! path . isFile ( ) ) return
168+ const sqlite = await useCellar ( ) . has ( { project : "sqlite.org" , constraint : new semver . Range ( '*' ) } )
169+ if ( ! sqlite ) return
170+ const ext = host ( ) . platform == 'darwin' ? 'dylib' : 'so'
171+ return new Database ( path . string , { readonly : true , sqlite3 : sqlite . path . join ( `lib/libsqlite3.${ ext } ` ) . string } )
172+ } catch {
173+ console . warn ( "couldn’t load pantry.db" )
174+ return
175+ }
171176}
172177
173178import install from "../porcelain/install.ts"
You can’t perform that action at this time.
0 commit comments