File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,22 @@ async function dep() {
5959 console . log ( `Downloading "https://deployer.org/deployer.phar".` )
6060 execa . commandSync ( 'curl -LO https://deployer.org/deployer.phar' )
6161 } else {
62- if ( ! / ^ v / . test ( version ) ) {
63- version = 'v' + version
62+ version = version . replace ( / ^ v / , '' )
63+ let { stdout} = execa . commandSync ( `curl -L https://deployer.org/manifest.json` )
64+ let manifest = JSON . parse ( stdout )
65+ let url
66+ for ( let asset of manifest ) {
67+ if ( asset . version === version ) {
68+ url = asset . url
69+ break
70+ }
71+ }
72+ if ( url === null ) {
73+ console . error ( `The version "${ version } "" does not found in the "https://deployer.org/manifest.json" file."` )
74+ } else {
75+ console . log ( `Downloading "${ url } ".` )
76+ execa . commandSync ( `curl -LO ${ url } ` )
6477 }
65- console . log ( `Downloading "https://deployer.org/releases/${ version } /deployer.phar".` )
66- execa . commandSync ( `curl -LO https://deployer.org/releases/${ version } /deployer.phar` )
6778 }
6879 execa . commandSync ( 'sudo chmod +x deployer.phar' )
6980 dep = 'deployer.phar'
You can’t perform that action at this time.
0 commit comments