File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,29 @@ RED='\033[0;31m'
7
7
BOLD=' \033[1m'
8
8
NC=' \033[0m'
9
9
10
- VERSION=$( npm list netepscript -g --depth=0 2> /dev/null | grep netepscript | cut -d@ -f2)
10
+ # Función para obtener la versión de npm
11
+ get_npm_version () {
12
+ npm view netepscript version 2> /dev/null
13
+ }
14
+
15
+ # Función para obtener la versión de GitHub
16
+ get_github_version () {
17
+ curl -s https://raw.githubusercontent.com/Synergy2Dev/netepScript/main/package.json | grep -oP ' "version": "\K[^"]+'
18
+ }
19
+
20
+ # Intenta obtener la versión de npm
21
+ VERSION=$( get_npm_version)
22
+
23
+ # Si no se puede obtener de npm, intenta obtenerla de GitHub
24
+ if [ -z " $VERSION " ]; then
25
+ VERSION=$( get_github_version)
26
+ fi
27
+
28
+
29
+ if [ -z " $VERSION " ]; then
30
+ VERSION=" desconocida"
31
+ echo -e " ${YELLOW} Advertencia: No se pudo determinar la versión de netepscript${NC} "
32
+ fi
11
33
12
34
echo -e " ${GREEN} =========================================================${NC} "
13
35
echo -e " ${BLUE} ${BOLD} netepScript v${VERSION}${NC} "
You can’t perform that action at this time.
0 commit comments