Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
bf0d513e
Unverified
Commit
bf0d513e
authored
Mar 25, 2020
by
neil
Committed by
GitHub
Mar 25, 2020
Browse files
Merge pull request #2798 from oliverblaha/dev
add support for upgrade from tag
parents
2be435ff
cb7e3857
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
bf0d513e
...
...
@@ -6317,7 +6317,7 @@ _installOnline() {
if
./
$PROJECT_ENTRY
install
"
$_nocron
"
""
"
$_noprofile
"
;
then
_info
"Install success!"
_initpath
_saveaccountconf
"UPGRADE_HASH"
"
$(
_get
Master
Hash
)
"
_saveaccountconf
"UPGRADE_HASH"
"
$(
_get
Upgrade
Hash
)
"
fi
cd
..
...
...
@@ -6327,19 +6327,27 @@ _installOnline() {
)
}
_getMasterHash
()
{
_getRepoHash
()
{
_hash_path
=
$1
shift
_hash_url
=
"https://api.github.com/repos/acmesh-official/
$PROJECT_NAME
/git/refs/
$_hash_path
"
_get
$_hash_url
|
tr
-d
"
\r\n
"
|
tr
'{},'
'\n'
|
grep
'"sha":'
|
cut
-d
'"'
-f
4
}
_getUpgradeHash
()
{
_b
=
"
$BRANCH
"
if
[
-z
"
$_b
"
]
;
then
_b
=
"master"
fi
_hash_url
=
"https://api.github.com/repos/acmesh-official/
$PROJECT_NAME
/git/refs/heads/
$_b
"
_get
$_hash_url
|
tr
-d
"
\r\n
"
|
tr
'{},'
'\n'
|
grep
'"sha":'
|
cut
-d
'"'
-f
4
_hash
=
$(
_getRepoHash
"heads/
$_b
"
)
if
[
-z
"
$_hash
"
]
;
then
_hash
=
$(
_getRepoHash
"tags/
$_b
"
)
;
fi
echo
$_hash
}
upgrade
()
{
if
(
_initpath
[
-z
"
$FORCE
"
]
&&
[
"
$(
_get
Master
Hash
)
"
=
"
$(
_readaccountconf
"UPGRADE_HASH"
)
"
]
&&
_info
"Already uptodate!"
&&
exit
0
[
-z
"
$FORCE
"
]
&&
[
"
$(
_get
Upgrade
Hash
)
"
=
"
$(
_readaccountconf
"UPGRADE_HASH"
)
"
]
&&
_info
"Already uptodate!"
&&
exit
0
export
LE_WORKING_DIR
cd
"
$LE_WORKING_DIR
"
_installOnline
"nocron"
"noprofile"
...
...
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