update genrepo script

This commit is contained in:
lxsang 2020-12-17 13:53:12 +01:00
parent 49a3629094
commit 811b22e84f
3 changed files with 40 additions and 6 deletions

View File

@ -6,6 +6,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.5-a", "version": "0.0.5-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/About/build/release/About.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/About/build/release/About.zip"
}, },
{ {
@ -15,6 +16,7 @@
"category": "System", "category": "System",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.6-a", "version": "0.0.6-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ActivityMonitor/build/release/ActivityMonitor.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ActivityMonitor/build/release/ActivityMonitor.zip"
}, },
{ {
@ -24,6 +26,7 @@
"category": "Library", "category": "Library",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.1.4-a", "version": "0.1.4-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/build/release/Antunnel.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/build/release/Antunnel.zip"
}, },
{ {
@ -33,6 +36,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.2-a", "version": "0.0.2-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Archive/build/release/Archive.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Archive/build/release/Archive.zip"
}, },
{ {
@ -42,6 +46,7 @@
"category": "Internet", "category": "Internet",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.2.3-a", "version": "0.2.3-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Blogger/build/release/Blogger.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Blogger/build/release/Blogger.zip"
}, },
{ {
@ -51,6 +56,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.2.0-a", "version": "0.2.0-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Booklet/build/release/Booklet.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Booklet/build/release/Booklet.zip"
}, },
{ {
@ -60,6 +66,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.1.2-a", "version": "0.1.2-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Clipper/build/release/Clipper.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Clipper/build/release/Clipper.zip"
}, },
{ {
@ -69,6 +76,7 @@
"category": "Other", "category": "Other",
"author": "", "author": "",
"version": "0.0.2-a", "version": "0.0.2-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DBDecoder/build/release/DBDecoder.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DBDecoder/build/release/DBDecoder.zip"
}, },
{ {
@ -78,6 +86,7 @@
"category": "Other", "category": "Other",
"author": "", "author": "",
"version": "0.0.5-a", "version": "0.0.5-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/build/release/Docify.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/build/release/Docify.zip"
}, },
{ {
@ -87,6 +96,7 @@
"category": "Office", "category": "Office",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.8-a", "version": "0.0.8-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/build/release/GraphEditor.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/build/release/GraphEditor.zip"
}, },
{ {
@ -96,6 +106,7 @@
"category": "Other", "category": "Other",
"author": "", "author": "",
"version": "0.1.3-a", "version": "0.1.3-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/JarvisControl/build/release/JarvisControl.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/JarvisControl/build/release/JarvisControl.zip"
}, },
{ {
@ -105,6 +116,7 @@
"category": "System", "category": "System",
"author": "Xuan Sang LEs", "author": "Xuan Sang LEs",
"version": "0.0.6-a", "version": "0.0.6-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/LuaPlayground/build/release/LuaPlayground.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/LuaPlayground/build/release/LuaPlayground.zip"
}, },
{ {
@ -114,6 +126,7 @@
"category": "Utils", "category": "Utils",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.6-a", "version": "0.0.6-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/MarkOn/build/release/MarkOn.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/MarkOn/build/release/MarkOn.zip"
}, },
{ {
@ -123,6 +136,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.1.3-a", "version": "0.1.3-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/OpenPage/build/release/OpenPage.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/OpenPage/build/release/OpenPage.zip"
}, },
{ {
@ -132,6 +146,7 @@
"category": "Utils", "category": "Utils",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.7-a", "version": "0.0.7-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Preview/build/release/Preview.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Preview/build/release/Preview.zip"
}, },
{ {
@ -141,6 +156,7 @@
"category": "Other", "category": "Other",
"author": "", "author": "",
"version": "0.1.0-a", "version": "0.1.0-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/RemoteDesktop/build/release/RemoteDesktop.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/RemoteDesktop/build/release/RemoteDesktop.zip"
}, },
{ {
@ -150,6 +166,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.4-a", "version": "0.0.4-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ShowCase/build/release/ShowCase.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ShowCase/build/release/ShowCase.zip"
}, },
{ {
@ -159,6 +176,7 @@
"category": "Other", "category": "Other",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.4-a", "version": "0.0.4-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/TinyEditor/build/release/TinyEditor.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/TinyEditor/build/release/TinyEditor.zip"
}, },
{ {
@ -168,6 +186,7 @@
"category": "Office", "category": "Office",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.2-a", "version": "0.0.2-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/VizApp/build/release/VizApp.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/VizApp/build/release/VizApp.zip"
}, },
{ {
@ -177,6 +196,7 @@
"category": "System", "category": "System",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.1.6-a", "version": "0.1.6-a",
"dependencies": ["Antunnel@0.1.4-a","blabla@blbl"],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip"
}, },
{ {
@ -186,6 +206,7 @@
"category": "System", "category": "System",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.5-a", "version": "0.0.5-a",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/wTerm/build/release/wTerm.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/wTerm/build/release/wTerm.zip"
} }

View File

@ -5,21 +5,29 @@ set -e
repodir=$1 repodir=$1
repofile=$2 repofile=$2
function get_json_entry() function get_json_string_entry()
{ {
cmd="cat $1 | sed -n 's/\"$2\"[[:space:]]*:[[:space:]]*\"\(.*\)\"[[:space:]]*,*/\1/p'|sed -e 's/^[[:space:]]*//'" cmd="cat $1 | sed -n 's/\"$2\"[[:space:]]*:[[:space:]]*\"\(.*\)\"[[:space:]]*,*/\1/p'|sed -e 's/^[[:space:]]*//'"
value=$(eval "$cmd") value=$(eval "$cmd")
echo "$value" echo "$value"
} }
function get_json_array_entry()
{
cmd="cat $1 | sed -e ':a' -e 'N' -e '\$!ba' -e 's/\\n/ /g' | sed -n 's/.*\"$2\"[[:space:]]*:[[:space:]]*\[\(.*\)\][[:space:]]*.*/\1/p'|sed -e 's/[[:space:]]//g'"
value=$(eval "$cmd")
echo "$value"
}
function join_by { local IFS="$1"; shift; echo "$*"; } function join_by { local IFS="$1"; shift; echo "$*"; }
function gen_pkg_meta() function gen_pkg_meta()
{ {
author=$(get_json_entry "$1/package.json" "author") author=$(get_json_string_entry "$1/package.json" "author")
name=$(get_json_entry "$1/package.json" "name") name=$(get_json_string_entry "$1/package.json" "name")
category=$(get_json_entry "$1/package.json" "category") category=$(get_json_string_entry "$1/package.json" "category")
version=$(get_json_entry "$1/package.json" "version") version=$(get_json_string_entry "$1/package.json" "version")
dependencies=$(get_json_array_entry "$1/package.json" "dependencies")
printf "\t{\n" printf "\t{\n"
printf "\t\t\"pkgname\": \"%s\",\n" "$2" printf "\t\t\"pkgname\": \"%s\",\n" "$2"
printf "\t\t\"name\": \"%s\",\n" "$name" printf "\t\t\"name\": \"%s\",\n" "$name"
@ -27,9 +35,11 @@ function gen_pkg_meta()
printf "\t\t\"category\": \"%s\",\n" "$category" printf "\t\t\"category\": \"%s\",\n" "$category"
printf "\t\t\"author\": \"%s\",\n" "$author" printf "\t\t\"author\": \"%s\",\n" "$author"
printf "\t\t\"version\": \"%s\",\n" "$version" printf "\t\t\"version\": \"%s\",\n" "$version"
printf "\t\t\"dependencies\": [%s],\n" "$dependencies"
printf "\t\t\"download\": \"https://raw.githubusercontent.com/lxsang/antosdk-apps/master/%s/build/release/%s.zip\"\n" "$2" "$2" printf "\t\t\"download\": \"https://raw.githubusercontent.com/lxsang/antosdk-apps/master/%s/build/release/%s.zip\"\n" "$2" "$2"
printf "\t}\n" printf "\t}\n"
} }
# generate packages meta-data # generate packages meta-data
[ ! -d "$repodir" ] && echo "No such directory: $repodir" && exit 1 [ ! -d "$repodir" ] && echo "No such directory: $repodir" && exit 1
[ -z "$repofile" ] && repofile="packages.json" [ -z "$repofile" ] && repofile="packages.json"

View File

@ -10,7 +10,10 @@
"category":"System", "category":"System",
"iconclass":"fa fa-terminal", "iconclass":"fa fa-terminal",
"mimes":["none"], "mimes":["none"],
"dependencies": ["Antunnel@0.1.4-a"], "dependencies": [
"Antunnel@0.1.4-a",
"blabla@blbl"
],
"locales":{ "locales":{
"fr_FR": { "fr_FR": {
"Open terminal": "Ouvrir terminal", "Open terminal": "Ouvrir terminal",