parent
7140b7c6b6
commit
3b342985ae
|
@ -0,0 +1,40 @@
|
|||
# In all environments, the following files are loaded if they exist,
|
||||
# the latter taking precedence over the former:
|
||||
#
|
||||
# * .env contains default values for the environment variables needed by the app
|
||||
# * .env.local uncommitted file with local overrides
|
||||
# * .env.$APP_ENV committed environment-specific defaults
|
||||
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
||||
#
|
||||
# Real environment variables win over .env files.
|
||||
#
|
||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
||||
# https://symfony.com/doc/current/configuration/secrets.html
|
||||
#
|
||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=dev
|
||||
APP_SECRET=d423d1302b974417d415b10bcde25767
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"
|
||||
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> symfony/messenger ###
|
||||
# Choose one of the transports below
|
||||
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
|
||||
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
|
||||
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
||||
###< symfony/messenger ###
|
||||
|
||||
###> symfony/mailer ###
|
||||
# MAILER_DSN=null://null
|
||||
###< symfony/mailer ###
|
|
@ -0,0 +1,6 @@
|
|||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
|
|
@ -0,0 +1,33 @@
|
|||
/app/bootstrap.php.cache
|
||||
/app/cache/*
|
||||
/app/config/parameters.yml
|
||||
/app/logs/*
|
||||
!app/cache/.gitkeep
|
||||
!app/logs/.gitkeep
|
||||
/app/phpunit.xml
|
||||
/bin/
|
||||
/build/
|
||||
/composer.phar
|
||||
/var/*
|
||||
/vendor/
|
||||
/web/bundles/
|
||||
/web/uploads/
|
||||
###> symfony/framework-bundle ###
|
||||
/.env.local
|
||||
/.env.local.php
|
||||
/.env.*.local
|
||||
/config/secrets/prod/prod.decrypt.private.php
|
||||
/public/bundles/
|
||||
/var/
|
||||
/vendor/
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> phpunit/phpunit ###
|
||||
/phpunit.xml
|
||||
.phpunit.result.cache
|
||||
###< phpunit/phpunit ###
|
||||
|
||||
###> symfony/phpunit-bridge ###
|
||||
.phpunit.result.cache
|
||||
/phpunit.xml
|
||||
###< symfony/phpunit-bridge ###
|
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +0,0 @@
|
|||
|
||||
<?php
|
||||
use OpenApi\Annotations as OpenApi;
|
||||
require('vendor/autoload.php');
|
||||
|
||||
$openapi = OpenApi\scan('/path/to/your/project');
|
||||
header('Content-Type: application/x-yaml');
|
||||
echo $openapi->toYaml();
|
130
swagger.json
130
swagger.json
|
@ -1,130 +0,0 @@
|
|||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"title": "My API",
|
||||
"version": "1.0"
|
||||
},
|
||||
"paths": {
|
||||
"/opengnsys3/rest/dhcp/subnet": {
|
||||
"get": {
|
||||
"operationId": "ece42bc4084486aedf42734bdb0b84cb",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Devuelve todas las subredes",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Subnet"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Error al obtener las subredes"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/opengnsys3/rest/dhcp/subnet/add": {
|
||||
"post": {
|
||||
"summary": "Add a new DHCP subnet",
|
||||
"operationId": "c8d5e4a10918078f17ab2ad4b73fc453",
|
||||
"requestBody": {
|
||||
"description": "JSON payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"properties": {
|
||||
"subnetId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mask": {
|
||||
"type": "string"
|
||||
},
|
||||
"address": {
|
||||
"type": "string"
|
||||
},
|
||||
"nextServer": {
|
||||
"type": "string"
|
||||
},
|
||||
"bootFileName": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Subnet added successfully",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"properties": {
|
||||
"success": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Error occurred",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"Subnet": {
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The ID of the subnet",
|
||||
"type": "integer"
|
||||
},
|
||||
"subnet": {
|
||||
"description": "The name of the subnet",
|
||||
"type": "string"
|
||||
},
|
||||
"next-server": {
|
||||
"description": "The next server in the subnet",
|
||||
"type": "string"
|
||||
},
|
||||
"boot-file-name": {
|
||||
"description": "The boot file name for the subnet",
|
||||
"type": "string"
|
||||
},
|
||||
"reservations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "The reservations in the subnet",
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
261
symfony.lock
261
symfony.lock
|
@ -1,261 +0,0 @@
|
|||
{
|
||||
"doctrine/annotations": {
|
||||
"version": "2.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "a2759dd6123694c8d901d0ec80006e044c2e6457"
|
||||
},
|
||||
"files": [
|
||||
"config/routes/annotations.yaml"
|
||||
]
|
||||
},
|
||||
"doctrine/doctrine-bundle": {
|
||||
"version": "2.11",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "2.4",
|
||||
"ref": "013b823e7fee65890b23e40f31e6667a1ac519ac"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/doctrine.yaml",
|
||||
"src/Entity/.gitignore",
|
||||
"src/Repository/.gitignore"
|
||||
]
|
||||
},
|
||||
"doctrine/doctrine-migrations-bundle": {
|
||||
"version": "3.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "3.1",
|
||||
"ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/doctrine_migrations.yaml",
|
||||
"migrations/.gitignore"
|
||||
]
|
||||
},
|
||||
"phpunit/phpunit": {
|
||||
"version": "9.6",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "9.6",
|
||||
"ref": "7364a21d87e658eb363c5020c072ecfdc12e2326"
|
||||
},
|
||||
"files": [
|
||||
".env.test",
|
||||
"phpunit.xml.dist",
|
||||
"tests/bootstrap.php"
|
||||
]
|
||||
},
|
||||
"symfony/console": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "da0c8be8157600ad34f10ff0c9cc91232522e047"
|
||||
},
|
||||
"files": [
|
||||
"bin/console"
|
||||
]
|
||||
},
|
||||
"symfony/debug-bundle": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/debug.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/flex": {
|
||||
"version": "1.21",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "146251ae39e06a95be0fe3d13c807bcf3938b172"
|
||||
},
|
||||
"files": [
|
||||
".env"
|
||||
]
|
||||
},
|
||||
"symfony/framework-bundle": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.4",
|
||||
"ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/cache.yaml",
|
||||
"config/packages/framework.yaml",
|
||||
"config/preload.php",
|
||||
"config/routes/framework.yaml",
|
||||
"config/services.yaml",
|
||||
"public/index.php",
|
||||
"src/Controller/.gitignore",
|
||||
"src/Kernel.php"
|
||||
]
|
||||
},
|
||||
"symfony/mailer": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "4.3",
|
||||
"ref": "2bf89438209656b85b9a49238c4467bff1b1f939"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/mailer.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/maker-bundle": {
|
||||
"version": "1.43",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
|
||||
}
|
||||
},
|
||||
"symfony/messenger": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.4",
|
||||
"ref": "8bd5f27013fb1d7217191c548e340f0bdb11912c"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/messenger.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/monolog-bundle": {
|
||||
"version": "3.10",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "3.7",
|
||||
"ref": "213676c4ec929f046dfde5ea8e97625b81bc0578"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/monolog.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/notifier": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.0",
|
||||
"ref": "178877daf79d2dbd62129dd03612cb1a2cb407cc"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/notifier.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/phpunit-bridge": {
|
||||
"version": "7.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "6.3",
|
||||
"ref": "1f5830c331065b6e4c9d5fa2105e322d29fcd573"
|
||||
},
|
||||
"files": [
|
||||
".env.test",
|
||||
"bin/phpunit",
|
||||
"phpunit.xml.dist",
|
||||
"tests/bootstrap.php"
|
||||
]
|
||||
},
|
||||
"symfony/routing": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "85de1d8ae45b284c3c84b668171d2615049e698f"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/routing.yaml",
|
||||
"config/routes.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/security-bundle": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "98f1f2b0d635908c2b40f3675da2d23b1a069d30"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/security.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/translation": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "da64f5a2b6d96f5dc24914517c0350a5f91dee43"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/translation.yaml",
|
||||
"translations/.gitignore"
|
||||
]
|
||||
},
|
||||
"symfony/twig-bundle": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.4",
|
||||
"ref": "bb2178c57eee79e6be0b297aa96fc0c0def81387"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/twig.yaml",
|
||||
"templates/base.html.twig"
|
||||
]
|
||||
},
|
||||
"symfony/validator": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "c32cfd98f714894c4f128bb99aa2530c1227603c"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/validator.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/web-profiler-bundle": {
|
||||
"version": "5.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.3",
|
||||
"ref": "24bbc3d84ef2f427f82104f766014e799eefcc3e"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/web_profiler.yaml",
|
||||
"config/routes/web_profiler.yaml"
|
||||
]
|
||||
},
|
||||
"twig/extra-bundle": {
|
||||
"version": "v3.8.0"
|
||||
}
|
||||
}
|
|
@ -1,218 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2021-present Fabien Potencier <fabien@symfony.com>
|
||||
#
|
||||
# Symfony CLI installer: this file is part of Symfony CLI project.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
CLI_CONFIG_DIR=".symfony5"
|
||||
CLI_EXECUTABLE="symfony"
|
||||
CLI_TMP_NAME="$CLI_EXECUTABLE-"$(date +"%s")
|
||||
CLI_NAME="Symfony CLI"
|
||||
CLI_DOWNLOAD_URL_PATTERN="https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_~platform~.tar.gz"
|
||||
|
||||
function output {
|
||||
style_start=""
|
||||
style_end=""
|
||||
if [ "${2:-}" != "" ]; then
|
||||
case $2 in
|
||||
"success")
|
||||
style_start="\033[0;32m"
|
||||
style_end="\033[0m"
|
||||
;;
|
||||
"error")
|
||||
style_start="\033[31;31m"
|
||||
style_end="\033[0m"
|
||||
;;
|
||||
"info"|"warning")
|
||||
style_start="\033[33m"
|
||||
style_end="\033[39m"
|
||||
;;
|
||||
"heading")
|
||||
style_start="\033[1;33m"
|
||||
style_end="\033[22;39m"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
builtin echo -e "${style_start}${1}${style_end}"
|
||||
}
|
||||
|
||||
output "${CLI_NAME} installer" "heading"
|
||||
|
||||
binary_dest="${HOME}/${CLI_CONFIG_DIR}/bin"
|
||||
custom_dir="false"
|
||||
|
||||
# Getops does not support long option names
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--install-dir=*)
|
||||
binary_dest="${1#*=}"
|
||||
custom_dir="true"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--install-dir)
|
||||
binary_dest="${2:-}"
|
||||
custom_dir="true"
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
*)
|
||||
output "Unknown option $1" "error"
|
||||
output "Usage: ${0} [--install-dir=dir]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Run environment checks.
|
||||
output "\nEnvironment check" "heading"
|
||||
|
||||
# Check that cURL or wget is installed.
|
||||
downloader=""
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
downloader="curl"
|
||||
output " [*] cURL is installed" "success"
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
downloader="wget"
|
||||
output " [*] wget is installed" "success"
|
||||
else
|
||||
output " [ ] ERROR: cURL or wget is required for installation." "error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check that tar is installed.
|
||||
if command -v tar >/dev/null 2>&1; then
|
||||
output " [*] Tar is installed" "success"
|
||||
else
|
||||
output " [ ] ERROR: Tar is required for installation." "error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check that Git is installed.
|
||||
if command -v git >/dev/null 2>&1; then
|
||||
output " [*] Git is installed" "success"
|
||||
else
|
||||
output " [ ] Warning: Git will be needed." "warning"
|
||||
fi
|
||||
|
||||
kernel=$(uname -s 2>/dev/null || /usr/bin/uname -s)
|
||||
case ${kernel} in
|
||||
"Linux"|"linux")
|
||||
kernel="linux"
|
||||
;;
|
||||
"Darwin"|"darwin")
|
||||
kernel="darwin"
|
||||
;;
|
||||
*)
|
||||
output "OS '${kernel}' not supported" "error"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
machine=$(uname -m 2>/dev/null || /usr/bin/uname -m)
|
||||
case ${machine} in
|
||||
arm|armv7*)
|
||||
machine="arm"
|
||||
;;
|
||||
aarch64*|armv8*|arm64)
|
||||
machine="arm64"
|
||||
;;
|
||||
i[36]86)
|
||||
machine="386"
|
||||
if [ "darwin" = "${kernel}" ]; then
|
||||
output " [ ] Your architecture (${machine}) is not supported anymore" "error"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
x86_64)
|
||||
machine="amd64"
|
||||
;;
|
||||
*)
|
||||
output " [ ] Your architecture (${machine}) is not currently supported" "error"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
output " [*] Your architecture (${machine}) is supported" "success"
|
||||
|
||||
if [ "darwin" = "${kernel}" ]; then
|
||||
machine="all"
|
||||
fi
|
||||
|
||||
platform="${kernel}_${machine}"
|
||||
|
||||
# The necessary checks have passed. Start downloading the right version.
|
||||
output "\nDownload" "heading"
|
||||
|
||||
latest_url=${CLI_DOWNLOAD_URL_PATTERN/~platform~/${platform}}
|
||||
output " Downloading ${latest_url}...";
|
||||
case $downloader in
|
||||
"curl")
|
||||
curl --fail --location "${latest_url}" > "/tmp/${CLI_TMP_NAME}.tar.gz"
|
||||
;;
|
||||
"wget")
|
||||
wget -q --show-progress "${latest_url}" -O "/tmp/${CLI_TMP_NAME}.tar.gz"
|
||||
;;
|
||||
esac
|
||||
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? != 0 ]; then
|
||||
output " The download failed." "error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
output " Uncompress binary..."
|
||||
tar -xz --directory "/tmp" -f "/tmp/${CLI_TMP_NAME}.tar.gz"
|
||||
rm "/tmp/${CLI_TMP_NAME}.tar.gz"
|
||||
|
||||
if [ ! -d "${binary_dest}" ]; then
|
||||
if ! mkdir -p "${binary_dest}"; then
|
||||
binary_dest="."
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${custom_dir}" == "true" ]; then
|
||||
output " Installing the binary into ${binary_dest} ..."
|
||||
else
|
||||
output " Installing the binary into your home directory..."
|
||||
fi
|
||||
|
||||
if mv "/tmp/${CLI_EXECUTABLE}" "${binary_dest}/${CLI_EXECUTABLE}"; then
|
||||
output " The binary was saved to: ${binary_dest}/${CLI_EXECUTABLE}"
|
||||
else
|
||||
output " Failed to move the binary to ${binary_dest}." "error"
|
||||
rm "/tmp/${CLI_EXECUTABLE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#output " Installing the shell auto-completion..."
|
||||
#"${binary_dest}/${CLI_EXECUTABLE}" self:shell-setup --silent
|
||||
#if [ $? != 0 ]; then
|
||||
# output " Failed to install the shell auto-completion." "warning"
|
||||
#fi
|
||||
|
||||
output "\nThe ${CLI_NAME} was installed successfully!" "success"
|
||||
|
||||
if [ "${custom_dir}" == "false" ]; then
|
||||
output "\nUse it as a local file:" "info"
|
||||
output " ${binary_dest}/${CLI_EXECUTABLE}"
|
||||
output "\nOr add the following line to your shell configuration file:" "info"
|
||||
output " export PATH=\"\$HOME/${CLI_CONFIG_DIR}/bin:\$PATH\""
|
||||
output "\nOr install it globally on your system:" "info"
|
||||
output " mv ${binary_dest}/${CLI_EXECUTABLE} /usr/local/bin/${CLI_EXECUTABLE}"
|
||||
output "\nThen start a new shell and run '${CLI_EXECUTABLE}'" "info"
|
||||
fi
|
Loading…
Reference in New Issue