File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44module Node
55 class << self
6- attr_reader :runtime , :package_manager
6+ attr_reader :runtime
77
88 def init
9- _ , _ , status = Open3 . capture3 ( "bun" , "-v" )
10- if status . success?
11- @runtime = "bun"
12- @package_manager = "bun"
13- return
9+ begin
10+ stdout , _ , status = Open3 . capture3 ( "bun" , "-v" )
11+ if status . success?
12+ @runtime = "bun"
13+ Jekyll . logger . info "Node:" , "[init] #{ @runtime } #{ stdout } "
14+ return
15+ end
16+ rescue
1417 end
1518
16- _ , stderr , status = Open3 . capture3 ( "node" , "-v" )
19+ stdout , stderr , status = Open3 . capture3 ( "node" , "-v" )
1720 raise stderr unless status . success?
18-
1921 @runtime = "node"
20- @package_manager = "npm "
22+ Jekyll . logger . info "Node:" , "[init] #{ @runtime } #{ stdout } "
2123 end
2224
2325 def call ( name , param )
Original file line number Diff line number Diff line change 1- /// <reference types="node" />
2- /// <reference types="bun" />
3-
41import fs from "fs" ;
52import path from "path" ;
63import sharp from "sharp" ;
74
85async function webp ( { source, destination } ) {
9- if ( Bun && Bun . Image ) {
6+ if ( global . Bun && Bun . Image ) {
107 await Bun . file ( source ) . image ( ) . webp ( ) . write ( destination ) ;
118 } else {
129 await sharp ( source ) . toFile ( destination ) ;
You can’t perform that action at this time.
0 commit comments