Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
089f8944
Commit
089f8944
authored
Apr 09, 2025
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm pack common.sh: add get_json_value and use it
parent
e244b6ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
1c-connect.sh
pack.d/1c-connect.sh
+1
-1
common.sh
pack.d/common.sh
+20
-0
postman.sh
pack.d/postman.sh
+1
-1
No files found.
pack.d/1c-connect.sh
View file @
089f8944
...
@@ -13,7 +13,7 @@ mv 1C-Connect-Linux-x64* opt/$PRODUCT
...
@@ -13,7 +13,7 @@ mv 1C-Connect-Linux-x64* opt/$PRODUCT
echo
"true"
>
./opt/
$PRODUCT
/app/bin/updater
echo
"true"
>
./opt/
$PRODUCT
/app/bin/updater
VERSION
=
"
$(
g
rep
version_name opt/
$PRODUCT
/dist.json |
sed
-e
's|",.*||'
-e
's|.*"||'
)
"
VERSION
=
"
$(
g
et_json_value opt/
$PRODUCT
/dist.json version_name
)
"
[
-n
"
$VERSION
"
]
||
fatal
"Can't get version from dist.json file."
[
-n
"
$VERSION
"
]
||
fatal
"Can't get version from dist.json file."
PKGNAME
=
$PRODUCT
-
$VERSION
PKGNAME
=
$PRODUCT
-
$VERSION
...
...
pack.d/common.sh
View file @
089f8944
...
@@ -78,6 +78,26 @@ has_wildcard()
...
@@ -78,6 +78,26 @@ has_wildcard()
[
"
${
1
/\*/
}
"
!=
"
$1
"
]
[
"
${
1
/\*/
}
"
!=
"
$1
"
]
}
}
# ["version"]
parse_json_value
()
{
local
field
=
"
$1
"
echo
"
$field
"
|
grep
-q
-E
"^
\[
"
||
field
=
'["'
$field
'"]'
epm tool json
-b
|
grep
-m1
-F
"
$field
"
|
sed
-e
's|.*[[:space:]]||'
|
sed
-e
's|"\(.*\)"|\1|g'
}
# URL/file ["version"]
get_json_value
()
{
if
is_url
"
$1
"
;
then
eget
-q
-O-
"
$1
"
| parse_json_value
"
$2
"
else
[
-s
"
$1
"
]
||
fatal
"File
$1
is missed, can't get json"
parse_json_value
"
$2
"
<
"
$1
"
fi
}
__handle_tarname
()
__handle_tarname
()
{
{
# TODO: we don't know PKGNAME here
# TODO: we don't know PKGNAME here
...
...
pack.d/postman.sh
View file @
089f8944
...
@@ -15,7 +15,7 @@ erc unpack $BASENAME.tar.gz || fatal
...
@@ -15,7 +15,7 @@ erc unpack $BASENAME.tar.gz || fatal
mkdir
-p
opt
mkdir
-p
opt
mv
Postman/app opt/postman
mv
Postman/app opt/postman
VERSION
=
$(
cat
"opt/postman/resources/app/package.json"
| epm
--inscript
tool json
-b
|
grep
version |
awk
'gsub(/"/, "", $2) {print $2}'
)
#'
VERSION
=
"
$(
get_json_value opt/postman/resources/app/package.json version
)
"
[
-n
"
$VERSION
"
]
||
fatal
"Can't get package version"
[
-n
"
$VERSION
"
]
||
fatal
"Can't get package version"
install_file opt/postman/resources/app/assets/icon.png /usr/share/pixmaps/postman.png
install_file opt/postman/resources/app/assets/icon.png /usr/share/pixmaps/postman.png
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment