@@ -2,8 +2,6 @@ import { Package, Installation } from "../types.ts"
22import SemVer from "../utils/semver.ts"
33import useConfig from "./useConfig.ts"
44import useCellar from "./useCellar.ts"
5- import host from "../utils/host.ts"
6- import * as os from "node:os"
75
86function tokenizePackage ( pkg : Package ) {
97 return [ { from : "prefix" , to : useCellar ( ) . keg ( pkg ) . string } ]
@@ -25,17 +23,6 @@ function tokenizeVersion(version: SemVer, prefix = 'version') {
2523 return rv
2624}
2725
28- //TODO replace `hw` with `host`
29- function tokenizeHost ( ) {
30- const { arch, target, platform } = host ( )
31- return [
32- { from : "hw.arch" , to : arch } ,
33- { from : "hw.target" , to : target } ,
34- { from : "hw.platform" , to : platform } ,
35- { from : "hw.concurrency" , to : os . cpus ( ) . length . toString ( ) }
36- ]
37- }
38-
3926function apply ( input : string , map : { from : string , to : string } [ ] ) {
4027 return map . reduce ( ( acc , { from, to} ) =>
4128 acc . replace ( new RegExp ( `(^\\$)?{{\\s*${ from } \\s*}}` , "g" ) , to ) ,
@@ -48,7 +35,6 @@ export default function() {
4835 apply,
4936 tokenize : {
5037 version : tokenizeVersion ,
51- host : tokenizeHost ,
5238 pkg : tokenizePackage
5339 }
5440 }
@@ -69,7 +55,6 @@ export default function() {
6955 ...tokenizePackage ( pkg ) ,
7056 ...pkgx ( ) ,
7157 ...base . tokenize . version ( pkg . version ) ,
72- ...base . tokenize . host ( ) ,
7358 ]
7459
7560 return {
0 commit comments