From 52a58b0ecef8a092c3d281ce3273f31eb8e50020 Mon Sep 17 00:00:00 2001 From: zdm Date: Thu, 13 Jul 2023 12:05:33 +0300 Subject: [PATCH] fix: install script --- bin/install.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 bin/install.js diff --git a/bin/install.js b/bin/install.js new file mode 100644 index 0000000..403eee6 --- /dev/null +++ b/bin/install.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +import Cli from "#core/cli"; +import externalResources from "#core/external-resources"; + +const CLI = { + "title": "Update resources", + "options": { + "force": { + "description": "Force build", + "default": false, + "schema": { + "type": "boolean", + }, + }, + }, +}; + +await Cli.parse( CLI ); + +externalResources.add( "softvisio-node/geoip-asn/resources/geolite2-asn" ); + +const res = await externalResources.update( { + "remote": true, + "force": process.cli.options.force, + "silent": false, +} ); + +if ( !res.ok ) process.exit( 1 );