Compare commits

..

No commits in common. "e030342ca5e52f6029ca3794ef8a7d231a2e9cf8" and "9d863e01888ac9464777b7a69d581b41622f98ab" have entirely different histories.

11 changed files with 134 additions and 217 deletions

View File

@ -9,131 +9,116 @@ function jaaENV {
echo " jaaENV --save …to_save (example: jaaENV --save nodejs php)"
echo ""
echo "Description:"
echo " - Without arguments, loads info from '.jaaENV'"
echo " - 'ls' shows supported options to auto-load"
echo " - 'save' creates a config file '.jaaENV'"
echo " - Without arguments loads infos from '.jaaENV'"
echo " - 'ls' shows supported options to auto load"
echo " - 'save' cerates config file '.jaaENV'"
echo ""
echo "Usage '.jaaENV' files: "
echo " typical: '\nphp=5.6\nnodejs=16.13.0'"
echo " link: '. ../.jaaENV' … use settings from parent folder"
echo " Options:"
echo " 'android_home': Exports 'ANDROID_HOME' (uses 'ANDROID_HOME_BAK') instead of 'ANDROID_SDK_ROOT'. Value can be anything (use '1')."
echo " 'jdk': Exports 'JAVA_HOME' based on the wanted version (currently 11/1.8)"
echo " 'android_home': Exports 'ANDROID_HOME' (uses 'ANDROID_HOME_BAK') instead of new 'ANDROID_SDK_ROOT'. Value can be anything (use '1')."
echo " 'jdk': Exports 'JAVA_HOME' based on wanted version (currently 11/1.8)"
echo " 'nodejs'|'php': NodeJS/PHP versions"
echo " 'gradle': Cordova uses folder-scoped → so unnecesarly"
echo " 'gradle': Cordova uses folder scoped → so unnecesarly"
echo ""
echo "Install: "
echo " gradle ⇒ https://sdkman.io/"
echo " node ⇒ https://github.com/nvm-sh/nvm"
echo " php ⇒ \`update-alternatives\` + https://deb.sury.org/"
echo " java ⇒ \`update-alternatives\`"
echo " php ⇒ http://jdem.cz/fgyu56 + https://deb.sury.org/"
echo ""
echo "Tips:"
echo " sudo update-alternatives --set php /usr/bin/php\$php"
return 0
fi
if [ "$1" == "--save" ]; then
if [ "$1" = "--save" ]; then
shift
rm -vi .jaaENV
while [ $# -gt 0 ]; do
while test $# -gt 0
do
case "$1" in
nodejs|node)
echo "nodejs=$(node --version | cut -c2-)" >> .jaaENV
local nodejs_version=$(node --version)
echo "nodejs=${nodejs_version:1}" >> .jaaENV
;;
gradle)
echo "gradle=$(gradle --version | awk '/Gradle/ {print $2}')" >> .jaaENV
local gradle_version=$(gradle --version | head -n 3 | tail -n 1 | §awk 2)
echo "gradle=$gradle_version" >> .jaaENV
;;
php)
echo "php=$(php --version | awk '/^PHP/ {print $2}')" >> .jaaENV
local php_version=$(php --version | head -n 1 | §awk 2)
echo "php=$php_version" >> .jaaENV
;;
java)
local java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$java_version" == 1.8* ]]; then
java_version=8
else
java_version=$(echo "$java_version" | cut -d'.' -f1)
fi
local java_version=$(java -version 2>&1 | head -n 1 | cut -d'"' -f2 | cut -d'.' -f1)
echo "java=$java_version" >> .jaaENV
;;
*)
echo "Unknown '$1' skipped"
echo "unknown '$1' skipped"
;;
esac
shift
done
return 0
fi
if [ "$1" == "--ls" ]; then
echo ":: nvm ls --no-alias ::"
nvm ls --no-alias
echo ":: update-alternatives --list php ::"
update-alternatives --list php
echo ":: update-alternatives --list java ::"
update-alternatives --list java
echo ":: sdk ls gradle | grep -E '\*|>' :: "
sdk ls gradle | grep -E '\*|>'
if [ "$1" = "--ls" ]; then
echo ":: nvm ls ::\n"
nvm ls
echo ":: find /usr/bin/ -name php* ::\n"
find /usr/bin/ -name php*
echo ":: sdk ls gradle | cat :: "
sdk ls gradle | cat
return 0
fi
if [ -f "compose.yaml" ]; then
jdk=$(grep -Po 'VERSION_JAVA=\K.*' compose.yaml)
nodejs=$(grep -Po 'VERSION_NODEJS=\K.*' compose.yaml)
elif [ -f ".jaaENV" ]; then
. ./.jaaENV
else
echo 'No env file `compose.yaml` or `.jaaENV`'
return 1
. ./.jaaENV
fi
if [ ! -z ${java+x} ]; then
[[ "$java" == "8" ]] && java=1.8
local java_local=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
local java_local=$(java -version 2>&1 | head -n 1 | cut -d'"' -f2)
if [[ "$java_local" != "$java"* ]]; then
[[ "$java" == "1.8" ]] && java=8
echo "Switching Java version: $java$java_local"
local java_path="/usr/lib/jvm/java-$java-openjdk-amd64/"
[[ "$java" == "8" ]] && java_path+="jre/"
sudo update-alternatives --set java "${java_path}bin/java"
echo "java $java$java_local"
local v="/usr/lib/jvm/java-$java-openjdk-amd64/"
[[ "$java" == "8" ]] && local vv="jre/" || local vv=""
sudo update-alternatives --set java ${v}${vv}bin/java
local javac=$(update-alternatives --list javac | grep java-$java)
[ -n "$javac" ] && sudo update-alternatives --set javac "$javac"
[ $javac ] && sudo update-alternatives --set javac $javac
sudo -k
fi
export JAVA_HOME=$(readlink -f $(which java) | cut -d '/' -f1-5)/
echo "\$JAVA_HOME=$JAVA_HOME"
export JAVA_HOME=$(update-alternatives --display java | grep momentálně | §awk 5 | cut -d \/ -f1-5)/
echo \$JAVA_HOME=$JAVA_HOME
fi
if [ ! -z ${android_home+x} ]; then
export ANDROID_HOME=$ANDROID_HOME_BAK
echo "\$ANDROID_HOME=$ANDROID_HOME"
else
unset ANDROID_HOME
echo "\$ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
fi
if [ ! -z ${android_home_is_sdk+x} ]; then
export ANDROID_HOME=$ANDROID_SDK_ROOT
echo "\$ANDROID_HOME=$ANDROID_HOME"
fi
if [ ! -z ${JAVA_HOME_BAK+x} ]; then export JAVA_HOME=$JAVA_HOME_BAK; unset JAVA_HOME_BAK; fi
if [ ! -z ${android_home+x} ]; then export ANDROID_HOME=$ANDROID_HOME_BAK; echo "\$ANDROID_HOME=$ANDROID_HOME"; else unset ANDROID_HOME; echo "\$ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"; fi
if [ ! -z ${android_home_is_sdk+x} ]; then export ANDROID_HOME=$ANDROID_SDK_ROOT; echo "\$ANDROID_HOME=$ANDROID_HOME"; fi
if [ ! -z ${jdk+x} ]; then
if (( $(echo "$jdk > 9" | bc -l) )); then
export JAVA_HOME_BAK=$JAVA_HOME
export JAVA_HOME="/snap/android-studio/current/android-studio/jre"
export JAVA_HOME_bk=$JAVA_HOME
export JAVA_HOME=/snap/android-studio/current/android-studio/jre;
elif [ ! -z ${JAVA_HOME_bk+x} ]; then
export JAVA_HOME=$JAVA_HOME_bk
fi
echo "\$JAVA_HOME=$JAVA_HOME"
fi
if [ ! -z ${nodejs+x} ]; then nvm use $nodejs; fi
if [ ! -z ${gradle+x} ]; then sdk use gradle $gradle | tr -d '\n'; echo ; fi
if [ ! -z ${php+x} ]; then
local php_local=$(php --version | awk '/^PHP/ {print $2}')
local php_local=$(php --version | head -n 1 | §awk 2)
if [[ "$php_local" == "$php"* ]]; then
echo "PHP version: $php"
echo "php $php"
else
echo "Switching PHP version: $php$php_local"
sudo update-alternatives --set php "/usr/bin/php$php"
echo "php $php$php_local"
sudo update-alternatives --set php /usr/bin/php$php
sudo -k
fi
fi
# Cleanup variables
unset android_home nodejs gradle php java
unset android_home
unset nodejs
unset gradle
unset php
unset java
}

View File

@ -1,5 +1,5 @@
#
# This library is free software; you can baseRedistribute it and/or
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
@ -27,20 +27,21 @@ base1=#282828
base2=#3f3f3f
base3=#808080
base4=#303030
baseKeyword=#C89FE3
baseString=#6FB2EA
baseKeyWord2=#747e9e
baseNumber=#F19B78
baseComment=#94B386
baseRed=#f00
baseRedbg=#751212
baseGreen=#859900
baseKeyword3=#DCB55F
baseFunction=#dcdcaa
vsblue=#AA89C0
aqua=#6FB2EA
bluegrey=#747e9e
orange=#CE9563
lime=#65ff00
grey=#94B386
red=#f00
redbg=#751212
green=#859900
blue=#268bd2
yellow=#dcdcaa
[named_styles]
default=base0;base1;true;false
error=baseRed
error=red
# Editor styles
@ -48,76 +49,76 @@ error=baseRed
selection=;#000000;;true
current_line=;#212121;true
brace_good=base0;base2;true
brace_bad=baseRed;;true
brace_bad=red;;true
margin_line_number=base3;base4
margin_folding=base3;#212121
fold_symbol_highlight=base2
indent_guide=base2;;true
caret=baseString;;false
caret=aqua;;false
marker_line=#fff;#00f;
marker_search=#fff;#d791a8;
marker_mark=;
call_tips=base0;base1
white_space=base3;;true
white_space=base2;;true
# Programming languages
#-------------------------------------------------------------------------------
comment=baseComment
comment=grey
comment_doc=comment
comment_line=comment
comment_line_doc=comment_doc
comment_doc_keyword=comment_doc,bold
comment_doc_keyword_error=comment_doc,italic
number=baseNumber
number=orange
number_1=number
number_2=number_1
type=baseKeyword;;true
class=baseString
function=baseFunction
type=vsblue;;true
class=aqua
function=yellow
parameter=function
keyword=baseKeyword;;true
keyword=vsblue;;true
keyword_1=keyword
keyword_2=baseKeyword3;;true
keyword_3=baseKeyWord2
keyword_2=blue;;true
keyword_3=bluegrey
keyword_4=keyword_3
identifier=default
identifier_1=identifier
identifier_2=baseNumber
identifier_3=identifier_2
identifier_4=identifier_3
identifier_2=identifier_1
identifier_3=identifier_1
identifier_4=identifier_1
string=baseString
string=aqua
string_1=string
string_2=string_1
string_3=default
string_4=default
string_eol=baseRed
string_eol=red
character=string_1
backticks=string_2
here_doc=string_2
scalar=string_2
label=keyword,bold
preprocessor=baseString
preprocessor=aqua
regex=number_1
operator=base0
decorator=string_1,bold
other=baseString
other=aqua
# Markup-type languages
#-------------------------------------------------------------------------------
tag=baseKeyword
tag=vsblue
tag_unknown=tag,bold
tag_end=tag,bold
attribute=baseString
attribute=aqua
attribute_unknown=attribute,bold
value=string_1
entity=default
@ -126,6 +127,6 @@ entity=default
# Diff
#-------------------------------------------------------------------------------
line_added=baseGreen
line_removed=baseRed
line_changed=baseKeyword3
line_added=green
line_removed=red
line_changed=blue

View File

@ -24,7 +24,7 @@ lexer.cpp.track.preprocessor=1
lexer.cpp.update.preprocessor=1
[settings=CSS]
extension=styl
extension=less
lexer_filetype=python
tag_parser=CSS

View File

@ -76,7 +76,7 @@ Stylus=*.styl;
#Swift=*.swift;
#Tcl=*.tcl;*.tk;*.wish;*.exp;
#Txt2tags=*.t2t;
TypeScript=*.ts;*.tsx;
TypeScript=*.ts;*.tsx;*.d.ts;
SCSS=*.scss
SVG=*.svg
#Vala=*.vala;*.vapi;

View File

@ -134,12 +134,12 @@ msgwin_messages_visible=true
msgwin_scribble_visible=true
warn_on_project_close=true
documents_show_paths=true
sidebar_page=3
sidebar_page=4
pref_main_project_session=true
use_native_windows_dialogs=false
treeview_position=226
msgwindow_position=755
geometry=1280;26;1277;1026;0;
treeview_position=245
msgwindow_position=699
geometry=0;26;1920;1054;1;
use_native_dialogs=true
[tools]
@ -204,17 +204,17 @@ find_close_dialog=true
replace_regexp=false
replace_regexp_multiline=false
replace_case_sensitive=false
replace_escape_sequences=true
replace_escape_sequences=false
replace_match_whole_word=false
replace_match_word_start=false
replace_search_backwards=false
replace_close_dialog=true
find_all_expanded=false
replace_all_expanded=true
position_find_x=2201
position_find_y=372
position_replace_x=504
position_replace_y=397
replace_all_expanded=false
position_find_x=1257
position_find_y=459
position_replace_x=-1
position_replace_y=-1
position_fif_x=-1
position_fif_y=-1
@ -228,7 +228,6 @@ session_file=
project_file_path=/home/jaandrle/Dokumenty/Projekty/geany
[files]
recent_files=/home/jaandrle/Stažené/config.xml;/home/jaandrle/Stažené/sentry.php.json;/home/jaandrle/Vzdálené/GitHub/DHLC-Internet-Networking-old/web/api/index.php;/media/jaandrle/WARTY WARTH/geany/filetype_extensions.conf;/media/jaandrle/WARTY WARTH/geany/plugins/geanydoc/geanydoc.conf;/media/jaandrle/WARTY WARTH/geany/plugins/saveactions/saveactions.conf;/media/jaandrle/WARTY WARTH/geany/plugins/vimode/vimode.conf;/media/jaandrle/WARTY WARTH/geany/plugins/filebrowser/filebrowser.conf;/media/jaandrle/WARTY WARTH/geany/plugins/VC/VC.conf;/media/jaandrle/WARTY WARTH/geany/plugins/spellcheck/spellcheck.conf;
recent_files=/home/jaandrle/Vzdálené/GitHub/Facilitator-App-Native/app/(app)/dashboard.tsx;/home/jaandrle/Vzdálené/GitHub/Facilitator-App-Native/components/SessionList/index.ts;/home/jaandrle/bin/asana.mjs;/home/jaandrle/Stažené/goto_matching_brace-function.txt;/home/jaandrle/.config/geany/filedefs/filetypes.SCSS.conf;/home/jaandrle/.config/geany/filedefs/filetypes.Less.conf;/home/jaandrle/.config/geany/filedefs/filetypes.Vue.conf;/home/jaandrle/Vzdálené/GitHub/deka-dom-el/index.js;/home/jaandrle/Vzdálené/GitHub/Facilitator-App-Native/app.config.ts;/home/jaandrle/Vzdálené/GitHub/deka-dom-el/src/dom.js;
recent_projects=/home/jaandrle/Dokumenty/Projekty/geany/Facilitator-App-Native.geany;/home/jaandrle/Dokumenty/Projekty/geany/deka-dom-el.geany;/home/jaandrle/Dokumenty/Projekty/geany/Facilitator-App-Native;/home/jaandrle/Dokumenty/Projekty/geany/deka-dom-el;/home/jaandrle/Dokumenty/Projekty/geany/deka-dom-el/deka-dom-el;/home/jaandrle/Dokumenty/Projekty/geany/.babelrc;
current_page=0
FILE_NAME_0=0;XML;0;EUTF-8;1;1;0;%2Fhome%2Fjaandrle%2FStažené%2Fconfig.xml;0;4
current_page=-1

View File

@ -14,9 +14,9 @@ menu_reloadall=
file_openlasttab=
menu_quit=<Primary>q
menu_undo=<Primary>z
menu_redo=<Primary><Shift>z
edit_duplicateline=
edit_deleteline=
menu_redo=<Primary>y
edit_duplicateline=<Primary>d
edit_deleteline=<Primary>k
edit_deletelinetoend=<Primary><Shift>Delete
edit_deletelinetobegin=<Primary><Shift>BackSpace
edit_transposeline=
@ -24,7 +24,7 @@ edit_scrolltoline=<Primary><Shift>l
edit_scrolllineup=<Alt>Up
edit_scrolllinedown=<Alt>Down
edit_completesnippet=Tab
move_snippetnextcursor=<Shift>ISO_Left_Tab
move_snippetnextcursor=
edit_suppresssnippetcompletion=
popup_contextaction=
edit_autocomplete=<Primary>space
@ -64,7 +64,7 @@ edit_sendtocmd9=
edit_sendtovte=
format_reflowparagraph=<Primary>j
edit_joinlines=
menu_insert_date=
menu_insert_date=<Shift><Alt>d
edit_insertwhitespace=
edit_insertlinebefore=
edit_insertlineafter=
@ -140,7 +140,7 @@ switch_compiler=
switch_messages=
switch_scribble=F6
switch_vte=F4
switch_sidebar=<Shift>F2
switch_sidebar=
switch_sidebar_symbol_list=
switch_sidebar_doc_list=
switch_tableft=<Primary>Page_Up
@ -171,8 +171,8 @@ switch_head_impl=<Shift><Alt>s
goto_file=<Shift><Alt>g
[commander]
show_panel=
show_panel_commands=<Primary>semicolon
show_panel=<Primary>semicolon
show_panel_commands=
show_panel_files=
[file_browser]

View File

@ -8,9 +8,9 @@
"file_name": "github-desktop",
"exec": "yes",
"description": "Fork of GitHub Desktop to support various Linux distributions",
"last_update": "2024-08-10T17:00:04Z",
"last_update": "2024-07-01T20:15:47Z",
"downloads": "/home/jaandrle/bin/github-desktop",
"version": "release-3.4.3-linux1",
"version": "release-3.4.2-linux1",
"glare": ".*x86_64.*.AppImage"
},
{
@ -21,8 +21,8 @@
"exec": "yes",
"description": "AI Browser",
"glare": "AppImage",
"last_update": "2024-07-29T15:29:11Z",
"version": "2.1.17",
"last_update": "2024-07-17T20:36:36Z",
"version": "2.0.4",
"downloads": "/home/jaandrle/bin/pinokio"
},
{
@ -44,9 +44,9 @@
"group": "nondev",
"file_name": "youtube-music",
"exec": "yes",
"last_update": "2024-08-01T11:48:59Z",
"last_update": "2024-07-14T15:26:52Z",
"downloads": "/home/jaandrle/bin/youtube-music",
"version": "v3.5.1",
"version": "v3.4.1",
"glare": "AppImage"
},
{
@ -176,9 +176,9 @@
"group": "nondev",
"file_name": "fedistar",
"exec": "yes",
"last_update": "2024-08-08T13:46:23Z",
"last_update": "2024-07-21T09:19:41Z",
"downloads": "/home/jaandrle/bin/fedistar",
"version": "v1.9.10",
"version": "v1.9.9",
"glare": ".*amd64.*.AppImage"
},
{
@ -188,9 +188,9 @@
"group": "ai",
"file_name": "ollama",
"exec": "yes",
"last_update": "2024-08-13T20:27:42Z",
"last_update": "2024-07-21T18:21:56Z",
"downloads": "/home/jaandrle/bin/ollama",
"version": "v0.3.6",
"version": "v0.2.8-rc1",
"glare": "linux-amd64"
},
{
@ -212,9 +212,9 @@
"group": "dev",
"file_name": "escrcpy",
"exec": "yes",
"last_update": "2024-08-03T17:09:45Z",
"last_update": "2024-07-14T08:47:24Z",
"downloads": "/home/jaandrle/bin/escrcpy",
"version": "v1.22.4",
"version": "v1.21.4",
"glare": ".*x86_64.*.AppImage"
},
{

View File

@ -21,11 +21,4 @@
"command": "git",
"args": { "argv": [ "browse" ] }
},
{
"caption": "Branch -D --all (delete remote and local branch)",
"command": "delete_branch",
"args": {
"argv": [ true, true, true ]
}
}
]

View File

@ -8,5 +8,4 @@
"side_bar_layout": "tabs",
"signature_error_highlighting": "no_public_key",
"theme": "Merge Dark.sublime-theme",
"expand_merge_commits_by_default": true,
}

50
.ctags
View File

@ -1,51 +1,5 @@
--exclude="*/node_modules/*"
--exclude=*.min.js
--exclude=*.min.css
--exclude=*.map
--exclude=.backup
--exclude=.sass-cache
--exclude=vendors
--exclude=.git
--langdef=css
--langmap=css:.css
--langmap=css:+.styl
--langmap=css:+.less
--regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-css=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--langdef=scss
--langmap=scss:.sass
--langmap=scss:+.scss
--regex-scss=/^[ \t]*@mixin ([A-Za-z0-9_-]+)/\1/m,mixin,mixins/
--regex-scss=/^[ \t]*@function ([A-Za-z0-9_-]+)/\1/f,function,functions/
--regex-scss=/^[ \t]*\$([A-Za-z0-9_-]+)/\1/v,variable,variables/
--regex-scss=/^([A-Za-z0-9_-]*)*\.([A-Za-z0-9_-]+) *[,{]/\2/c,class,classes/
--regex-scss=/^[ \t]+\.([A-Za-z0-9_-]+) *[,{]/\1/c,class,classes/
--regex-scss=/^(.*)*\#([A-Za-z0-9_-]+) *[,{]/\2/i,id,ids/
--regex-scss=/^[ \t]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-scss=/(^([A-Za-z0-9_-])*([A-Za-z0-9_-]+)) *[,|\{]/\1/t,tag,tags/
--regex-scss=/(^([^\/\/])*)[ \t]+([A-Za-z0-9_-]+)) *[,|\{]/\3/t,tag,tags/
--regex-scss=/(^(.*, *)([A-Za-z0-9_-]+)) *[,|\{]/\3/t,tag,tags/
--regex-scss=/(^[ \t]+([A-Za-z0-9_-]+)) *[,|\{]/\1/t,tag,tags/
--regex-scss=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/d,media,media/
--langdef=stylus
--langmap=stylus:.styl
--regex-stylus=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-stylus=/^[ \t]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-stylus=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-stylus=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--langdef=markdown
--langmap=markdown:.md
--regex-markdown=/^# (<.*>)?(.+)/\2/i,h1/
--regex-markdown=/^## (<.*>)?(.+)/\2/i,h2/
--regex-markdown=/^### (<.*>)?(.+)/\2/i,h3/
--langdef=js
--exclude=node_modules
--exclude=gulp
--langmap=javascript:.js.es6.es.jsx.mjs
--javascript-kinds=-c-f-m-p-v

View File

@ -37,11 +37,7 @@ const path_config= $.xdg.config`github-releases`;
const path_config_json= join(path_config, "config.json");
const path_config_lock= join(path_config, "lock");
const path_temp= $.xdg.temp`github-releases.json`;
let url_api= "github";
const urls_api= {
github: "https://api.github.com/repos/",
ungh: "https://ungh.cc/repos/"
};
const url_api= "https://api.github.com/repos/"; // "https://ungh.cc/repos/";
const url_download= "https://glare.now.sh/"; // https://github.com/Contextualist/glare
const css= echo.css`
.pkg { color: lightcyan; }
@ -52,19 +48,9 @@ const css= echo.css`
`;
$.api()
.version("2.1.0")
.version("2.0.0")
.describe("Helper for working with “packages” stored in GitHub releases.")
.option("--verbose", "Verbose output (WIP)")
.option("--group, -G", "Filter by group (not awaiable for noGRA)")
.option("--repository, -R", "Filter by repository (not awaiable for noGRA)")
.option("--api", [ "Choose API URL",
"- GitHub (default): https://api.github.com/repos/",
"- Ungh: https://ungh.cc/repos/", "(not awaiable for noGRA)" ], "github")
.command("unlock", "[noGRA] DANGER: Removes lock file. Use only if you know what you are doing!")
.action(function(){
s.rm(path_config_lock);
})
.command("config [mode]", [ "[noGR] Config (file), use `mode` with these options:",
.command("config [mode]", [ "Config (file), use `mode` with these options:",
"- `edit`: opens config file in terminal editor using `$EDITOR` (defaults to vim)",
"- `path`: prints path to config file"
])
@ -85,6 +71,8 @@ $.api()
"These are registered by this script but not managed by it (updates, etc).",
"Repositories marked with `+` signify that updates of the package are checked."
])
.option("--group, -G", "Filter by group")
.option("--repository, -R", "Filter by repository")
.action(function(filter){
const config = readConfig();
for(const { repository, version, description, group } of grepPackages(config, filter))
@ -95,6 +83,8 @@ $.api()
$.exit(0);
})
.command("check", "Shows/checks updates for registered packages")
.option("--group, -G", "Filter by group")
.option("--repository, -R", "Filter by repository")
.option("--cache", "Use cache [yes, no]", "yes")
.action(async function({ cache, ...filter }){
const config = readConfig();
@ -105,6 +95,8 @@ $.api()
$.exit(0);
})
.command("update", "Updates registered packages")
.option("--group, -G", "Filter by group")
.option("--repository, -R", "Filter by repository")
.action(async function(filter){
if(s.test("-f", path_config_lock))
return $.error(`The lock file '${path_config_lock}' already exists! Check if some other instance is running.`);
@ -135,7 +127,7 @@ $.api()
echo("Updating packages completed:");
for (const { status, value, reason } of updates) {
if(status==="rejected"){
echo("%c✗ TBD reason.local.repository: %c"+reason.err, css.err);
echo("%c✗ "+reason.local.repository+": %c"+reason.err, css.err);
continue;
}
const { local, remote }= value;
@ -170,17 +162,11 @@ async function download(value, onprogress, target){
return value;
}
function grepPackages({ packages }, { group, repository, api, verbose }){
if(api && api!==url_api && urls_api.hasOwnProperty(api))
url_api= api;
if(verbose)
echo(`Using API: ${url_api} (${urls_api[url_api]})`);
function grepPackages({ packages }, { group, repository }){
const f= {};
let is_filter= false;
if(group){ is_filter= true; f.group= group; }
if(repository){ is_filter= true; f.repository= repository; }
if(verbose)
echo("Filter:", f);
if(!is_filter) return packages;
return packages.filter(r=> Object.keys(f).every(k=> r[k]===f[k]));
}
@ -225,7 +211,7 @@ function packageStatus({ last_update: local }, { published_at: remote }){
async function fetchRelease({ repository, tag_name_regex }, cache){
const headers= { 'User-Agent': 'node' };
if(cache==="no") headers['Cache-Control'] = 'no-cache';
const url= urls_api[url_api]+repository+"/releases";
const url= url_api+repository+"/releases";
const releases= await fetch(url, { headers }).then(res=> res.json());
if(releases.message) return $.error(url+": "+releases.message);