File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Installs Bundler using the code from [ruby/setup-ruby].
3636
3737### apt: (Ubuntu)
3838
39- List of packages to install. Space delimited. Special options are ` _update_` and `_upgrade_` .
39+ List of packages to install. Space delimited. Including ` _upgrade_` will do so. `update` is always done .
4040
4141# ## brew: (macOS)
4242
Original file line number Diff line number Diff line change @@ -8,20 +8,19 @@ const { execSync } = require('./common')
88let apt = core . getInput ( 'apt-get' ) . replace ( / [ ^ a - z _ \d . - ] + / gi, '' ) . trim ( ) . toLowerCase ( )
99
1010export const run = async ( ) => {
11+ let needUpdate = true
1112 try {
1213 if ( apt !== '' ) {
13- if ( apt . includes ( '_update_' ) ) {
14- execSync ( 'sudo apt-get -qy update' )
15- apt = apt . replace ( / \b _ u p d a t e _ \b / gi, '' ) . trim ( )
16- }
1714
1815 if ( apt . includes ( '_upgrade_' ) ) {
1916 execSync ( 'sudo apt-get -qy update' )
17+ needUpdate = false
2018 execSync ( 'sudo apt-get -qy dist-upgrade' )
2119 apt = apt . replace ( / \b _ u p g r a d e _ \b / gi, '' ) . trim ( )
2220 }
2321
2422 if ( apt !== '' ) {
23+ if ( needUpdate ) { execSync ( 'sudo apt-get -qy update' ) }
2524 execSync ( `sudo apt-get -qy --no-install-recommends install ${ apt } ` )
2625 }
2726 }
Original file line number Diff line number Diff line change @@ -68,20 +68,19 @@ const { execSync } = __webpack_require__(498)
6868let apt = core . getInput ( 'apt-get' ) . replace ( / [ ^ a - z _ \d . - ] + / gi, '' ) . trim ( ) . toLowerCase ( )
6969
7070const run = async ( ) => {
71+ let needUpdate = true
7172 try {
7273 if ( apt !== '' ) {
73- if ( apt . includes ( '_update_' ) ) {
74- execSync ( 'sudo apt-get -qy update' )
75- apt = apt . replace ( / \b _ u p d a t e _ \b / gi, '' ) . trim ( )
76- }
7774
7875 if ( apt . includes ( '_upgrade_' ) ) {
7976 execSync ( 'sudo apt-get -qy update' )
77+ needUpdate = false
8078 execSync ( 'sudo apt-get -qy dist-upgrade' )
8179 apt = apt . replace ( / \b _ u p g r a d e _ \b / gi, '' ) . trim ( )
8280 }
8381
8482 if ( apt !== '' ) {
83+ if ( needUpdate ) { execSync ( 'sudo apt-get -qy update' ) }
8584 execSync ( `sudo apt-get -qy --no-install-recommends install ${ apt } ` )
8685 }
8786 }
You can’t perform that action at this time.
0 commit comments