Comparing version 0.7.0 to 0.8.0
@@ -29,3 +29,4 @@ "use strict"; | ||
alias: 'h', | ||
description: 'Hostname of the proxy, required for Bzz.link' | ||
description: 'Hostname of the proxy, required for Bzz.link', | ||
default: 'bzz-link.local' | ||
}) | ||
@@ -45,2 +46,15 @@ .withOption({ | ||
.withOption({ | ||
key: 'reupload', | ||
type: 'boolean', | ||
alias: 'r', | ||
description: 'Enables periodical content reupload' | ||
}) | ||
.withOption({ | ||
key: 'reupload-interval-ms', | ||
type: 'number', | ||
alias: 'i', | ||
description: 'Reupload interval in milliseconds', | ||
default: cafe_utility_1.Dates.minutes(2) | ||
}) | ||
.withOption({ | ||
key: 'all', | ||
@@ -51,2 +65,8 @@ type: 'boolean', | ||
}) | ||
.withOption({ | ||
key: 'debug', | ||
type: 'boolean', | ||
alias: 'd', | ||
description: 'Enables debug log level' | ||
}) | ||
.withFn((context) => __awaiter(this, void 0, void 0, function* () { | ||
@@ -57,10 +77,5 @@ const location = (0, utility_1.requireEnv)('CAFE_CLI_PROJECT_PROXY'); | ||
const cid = context.options['cid'] || context.options['all']; | ||
const reupload = context.options['reupload'] || context.options['all']; | ||
const stampManagement = context.options['stamp-management'] || context.options['all']; | ||
if (ens && !hostname) { | ||
throw new Error('Hostname is required for ENS'); | ||
} | ||
if (cid && !hostname) { | ||
throw new Error('Hostname is required for CID'); | ||
} | ||
const env = process.env; | ||
const env = { PATH: cafe_utility_1.Types.asString(process.env.PATH) }; | ||
if (stampManagement) { | ||
@@ -80,2 +95,9 @@ env.POSTAGE_DEPTH = '22'; | ||
} | ||
if (reupload) { | ||
env.REUPLOAD_PERIOD = cafe_utility_1.Types.asNumber(context.options['reupload-interval-ms']).toString(); | ||
} | ||
if (context.options['debug']) { | ||
env.LOG_LEVEL = 'debug'; | ||
} | ||
console.log('Starting with env:', env); | ||
cafe_utility_1.System.runProcess('npm', ['start'], { cwd: location, env }, x => process.stdout.write(x.toString()), x => process.stderr.write(x.toString())); | ||
@@ -82,0 +104,0 @@ }))); |
{ | ||
"name": "cafe-tui", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import { Command, Parser } from 'cafe-args' | ||
import { System, Types } from 'cafe-utility' | ||
import { Dates, System, Types } from 'cafe-utility' | ||
import { requireEnv } from '../utility' | ||
@@ -19,3 +19,4 @@ | ||
alias: 'h', | ||
description: 'Hostname of the proxy, required for Bzz.link' | ||
description: 'Hostname of the proxy, required for Bzz.link', | ||
default: 'bzz-link.local' | ||
}) | ||
@@ -35,2 +36,15 @@ .withOption({ | ||
.withOption({ | ||
key: 'reupload', | ||
type: 'boolean', | ||
alias: 'r', | ||
description: 'Enables periodical content reupload' | ||
}) | ||
.withOption({ | ||
key: 'reupload-interval-ms', | ||
type: 'number', | ||
alias: 'i', | ||
description: 'Reupload interval in milliseconds', | ||
default: Dates.minutes(2) | ||
}) | ||
.withOption({ | ||
key: 'all', | ||
@@ -41,2 +55,8 @@ type: 'boolean', | ||
}) | ||
.withOption({ | ||
key: 'debug', | ||
type: 'boolean', | ||
alias: 'd', | ||
description: 'Enables debug log level' | ||
}) | ||
.withFn(async context => { | ||
@@ -47,10 +67,5 @@ const location = requireEnv('CAFE_CLI_PROJECT_PROXY') | ||
const cid = context.options['cid'] || context.options['all'] | ||
const reupload = context.options['reupload'] || context.options['all'] | ||
const stampManagement = context.options['stamp-management'] || context.options['all'] | ||
if (ens && !hostname) { | ||
throw new Error('Hostname is required for ENS') | ||
} | ||
if (cid && !hostname) { | ||
throw new Error('Hostname is required for CID') | ||
} | ||
const env = process.env | ||
const env: Record<string, string> = { PATH: Types.asString(process.env.PATH) } | ||
if (stampManagement) { | ||
@@ -70,2 +85,9 @@ env.POSTAGE_DEPTH = '22' | ||
} | ||
if (reupload) { | ||
env.REUPLOAD_PERIOD = Types.asNumber(context.options['reupload-interval-ms']).toString() | ||
} | ||
if (context.options['debug']) { | ||
env.LOG_LEVEL = 'debug' | ||
} | ||
console.log('Starting with env:', env) | ||
System.runProcess( | ||
@@ -72,0 +94,0 @@ 'npm', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36738
846