@@ -2,7 +2,7 @@ const { Binary } = require('binary-install-raw')
2
2
const os = require ( 'os' )
3
3
const chalk = require ( 'chalk' )
4
4
const fetch = require ( 'node-fetch' )
5
- const { filesystem } = require ( 'gluegun/filesystem ' )
5
+ const { filesystem, print } = require ( 'gluegun' )
6
6
const { fixParameters } = require ( '../command-helpers/gluegun' )
7
7
const semver = require ( 'semver' )
8
8
const { spawn, exec } = require ( 'child_process' )
@@ -24,9 +24,6 @@ ${chalk.dim('Options:')}
24
24
module . exports = {
25
25
description : 'Runs rust binary for subgraph testing' ,
26
26
run : async toolbox => {
27
- // Obtain tools
28
- let { print } = toolbox
29
-
30
27
// Read CLI parameters
31
28
let {
32
29
c,
@@ -90,14 +87,14 @@ module.exports = {
90
87
opts . set ( "latestVersion" , json . tag_name )
91
88
92
89
if ( opts . get ( "docker" ) ) {
93
- runDocker ( datasource , opts , print )
90
+ runDocker ( datasource , opts )
94
91
} else {
95
- runBinary ( datasource , opts , print )
92
+ runBinary ( datasource , opts )
96
93
}
97
94
}
98
95
}
99
96
100
- async function runBinary ( datasource , opts , print ) {
97
+ async function runBinary ( datasource , opts ) {
101
98
let coverageOpt = opts . get ( "coverage" )
102
99
let forceOpt = opts . get ( "force" )
103
100
let logsOpt = opts . get ( "logs" )
@@ -110,7 +107,7 @@ async function runBinary(datasource, opts, print) {
110
107
const url = `https://github.com/LimeChain/matchstick/releases/download/${ versionOpt || latestVersion } /${ platform } `
111
108
112
109
if ( logsOpt ) {
113
- console . log ( `Download link: ${ url } ` )
110
+ print . info ( `Download link: ${ url } ` )
114
111
}
115
112
116
113
let binary = new Binary ( platform , url , versionOpt || latestVersion )
@@ -132,7 +129,7 @@ function getPlatform(logsOpt) {
132
129
const isM1 = cpuCore . model . includes ( "Apple M1" )
133
130
134
131
if ( logsOpt ) {
135
- console . log ( `OS type: ${ type } \nOS arch: ${ arch } \nOS release: ${ release } \nOS major version: ${ majorVersion } \nCPU model: ${ cpuCore . model } ` )
132
+ print . info ( `OS type: ${ type } \nOS arch: ${ arch } \nOS release: ${ release } \nOS major version: ${ majorVersion } \nCPU model: ${ cpuCore . model } ` )
136
133
}
137
134
138
135
if ( arch === 'x64' || ( arch === 'arm64' && isM1 ) ) {
@@ -158,7 +155,7 @@ function getPlatform(logsOpt) {
158
155
throw new Error ( `Unsupported platform: ${ type } ${ arch } ${ majorVersion } ` )
159
156
}
160
157
161
- async function runDocker ( datasource , opts , print ) {
158
+ async function runDocker ( datasource , opts ) {
162
159
let coverageOpt = opts . get ( "coverage" )
163
160
let forceOpt = opts . get ( "force" )
164
161
let versionOpt = opts . get ( "version" )
0 commit comments