@@ -28,7 +28,7 @@ const exec = promisify(execCb)
2828const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
2929
3030const argv = minimist ( process . argv . slice ( 2 ) , {
31- boolean : [ 'help' , 'version' ] ,
31+ boolean : [ 'help' , 'version' , 'assets' ] ,
3232 alias : { h : 'help' , v : 'version' }
3333} )
3434
@@ -38,8 +38,9 @@ function printHelp () {
3838Deploy a WordPress plugin or theme to WordPress.org SVN using wpDeployer in package.json.
3939
4040Options:
41- --help, -h Show this message
42- --version, -v Print wp-deployer version
41+ --help, -h Show this message
42+ --version, -v Print wp-deployer version
43+ --assets Deploy only the assets directory (plugin only; skips trunk and tag)
4344` )
4445}
4546
@@ -72,7 +73,7 @@ process.on('SIGINT', () => {
7273const wpDeployer = async ( ) => {
7374 console . log ( chalk . cyan ( 'Processing...' ) )
7475
75- const { settings, error, errorMessage } = resolveSettings ( pkg )
76+ let { settings, error, errorMessage } = resolveSettings ( pkg )
7677 if ( error === 'invalid_slug' ) {
7778 console . error ( chalk . red ( `Invalid slug: ${ errorMessage } ` ) )
7879 return EXIT_CONFIG
@@ -106,6 +107,19 @@ const wpDeployer = async () => {
106107 return EXIT_CONFIG
107108 }
108109
110+ if ( argv . assets ) {
111+ if ( settings . repoType !== 'plugin' ) {
112+ console . error ( chalk . red ( '--assets is only supported for plugins.' ) )
113+ return EXIT_CONFIG
114+ }
115+ settings = {
116+ ...settings ,
117+ deployTrunk : false ,
118+ deployTag : false ,
119+ deployAssets : true
120+ }
121+ }
122+
109123 try {
110124 runPreflightSync ( settings , { fs, awk } )
111125 } catch ( e ) {
0 commit comments