Skip to content

Commit 20dd47c

Browse files
authored
Adds GravitySMTP Support to Update Command (#43)
* Allow gravitysmtp to be updated via CLI tool * Bump version and changelog * Check if constant is defined; add checks to version command as well
1 parent e5dd487 commit 20dd47c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

change_log.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
= 1.6 =
2+
- Updated the plugin to support installing and updating Gravity SMTP.
3+
14
= 1.5 =
25
- Updated the plugin to allow its usage as a WP-CLI package.
36

cli.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Gravity Forms CLI
44
Plugin URI: https://gravityforms.com
55
Description: Manage Gravity Forms with the WP CLI.
6-
Version: 1.5
6+
Version: 1.6
77
Author: Rocketgenius
88
Author URI: https://gravityforms.com
99
License: GPL-2.0+
@@ -30,7 +30,7 @@
3030
defined( 'ABSPATH' ) || defined( 'WP_CLI' ) || die();
3131

3232
// Defines the current version of the CLI add-on
33-
define( 'GF_CLI_VERSION', '1.5' );
33+
define( 'GF_CLI_VERSION', '1.6' );
3434

3535
define( 'GF_CLI_MIN_GF_VERSION', '1.9.17.8' );
3636

includes/class-gf-cli-root.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public function version( $args, $assoc_args ) {
3737

3838
if ( $slug == 'gravityforms' ) {
3939
WP_CLI::log( GFForms::$version );
40+
} elseif ( $slug === 'gravitysmtp' ) {
41+
$current_version = defined( 'GF_GRAVITY_SMTP_VERSION' ) ? GF_GRAVITY_SMTP_VERSION : null;
4042
} else {
4143
$addon = $this->get_addon( $slug );
4244
WP_CLI::log( $addon->get_version() );
@@ -188,6 +190,8 @@ public function update( $args, $assoc_args ) {
188190

189191
if ( $slug === 'gravityforms' ) {
190192
$current_version = GFForms::$version;
193+
} elseif ( $slug === 'gravitysmtp' ) {
194+
$current_version = defined( 'GF_GRAVITY_SMTP_VERSION' ) ? GF_GRAVITY_SMTP_VERSION : null;
191195
} else {
192196
$addon = $this->get_addon( $slug );
193197
$current_version = $addon->get_version();
@@ -276,6 +280,8 @@ public function setup( $args, $assoc_args ) {
276280
WP_CLI::error( 'Use the --force flag to force the database setup.' );
277281
}
278282
}
283+
} elseif ( $slug ==='gravitysmtp' ) {
284+
WP_CLI::success( 'setup gravitysmtp' );
279285
} else {
280286
$addon = $this->get_addon( $slug );
281287
$addon->setup();

0 commit comments

Comments
 (0)