Skip to content

Commit

Permalink
fix: typo in the create_keychain command
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Apr 16, 2024
1 parent 5f36a46 commit 91039b6
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 87 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.14.1

## Fix

- Typo's in the `create_keychain` command

# 0.14.0

## Feat
Expand Down
2 changes: 1 addition & 1 deletion lib/src/integrations/android/android_command.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:args/command_runner.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/remove/android_create_keystore_command.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/create_keystore/android_create_keystore_command.dart';
import 'package:impaktfull_cli/src/core/command/command/root_command.dart';

class AndroidRootCommand extends RootCommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:impaktfull_cli/impaktfull_cli.dart';
import 'package:impaktfull_cli/src/core/command/command/cli_command.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/remove/android_create_keystore_command_config.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/remove/model/android_create_keystore_config_data.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/create_keystore/android_create_keystore_command_config.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/create_keystore/model/android_create_keystore_config_data.dart';
import 'package:impaktfull_cli/src/core/command/config/command_config.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/plugin/android_create_keystore_plugin.dart';

Expand Down Expand Up @@ -29,12 +29,12 @@ class AndroidCreateKeystoreCommand
ImpaktfullCliLogger.startSpinner('Creating keystore for $name');
await androidCreateKeyStorePlugin.createKeyStore(
name: name,
dNameFullName: configData.dNameFullName,
dNameOrganization: configData.dNameOrganization,
dNameOrganizationUnit: configData.dNameOrganizationUnit,
dNameCity: configData.dNameCity,
dNameState: configData.dNameState,
dNameCountry: configData.dNameCountry,
fullName: configData.fullName,
organization: configData.organization,
organizationUnit: configData.organizationUnit,
city: configData.city,
state: configData.state,
country: configData.country,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:args/args.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/remove/model/android_create_keystore_config_data.dart';
import 'package:impaktfull_cli/src/integrations/android/create_keystore/command/create_keystore/model/android_create_keystore_config_data.dart';
import 'package:impaktfull_cli/src/core/command/config/command_config.dart';
import 'package:impaktfull_cli/src/core/util/extensions/arg_result_extensions.dart';

class AndroidCreateKeyStoreCommandConfig
extends CommandConfig<AndroidCreateKeyStoreConfigData> {
static const String _optionConfigName = 'configName';
static const String _optionDNameFullName = 'dNameFullName';
static const String _optionDNameOrganization = 'dNameOrganization';
static const String _optionDNameOrganizationUnit = 'dNameOrganizationUnit';
static const String _optionDNameCity = 'dNameCity';
static const String _optionDNameState = 'dNameState';
static const String _optionDNameCountry = 'dNameCountry';
static const String _optionFullName = 'fullName';
static const String _optionOrganization = 'organization';
static const String _optionOrganizationUnit = 'organizationUnit';
static const String _optionCity = 'city';
static const String _optionState = 'state';
static const String _optionCountry = 'country';
static const defaultSigningConfigNames = ['debug', 'release'];

const AndroidCreateKeyStoreCommandConfig();
Expand All @@ -24,29 +24,29 @@ class AndroidCreateKeyStoreCommandConfig
defaultsTo: defaultSigningConfigNames,
);
argParser.addOption(
_optionDNameFullName,
_optionFullName,
help: 'Certificate info: Your full name',
mandatory: true,
);
argParser.addOption(
_optionDNameOrganization,
_optionOrganization,
help: 'Certificate info: Your organization name',
mandatory: true,
);
argParser.addOption(
_optionDNameOrganizationUnit,
_optionOrganizationUnit,
help: 'Certificate info: Your organization unit name',
);
argParser.addOption(
_optionDNameState,
_optionState,
help: 'Certificate info: Your state name',
);
argParser.addOption(
_optionDNameCity,
_optionCity,
help: 'Certificate info: Your city name',
);
argParser.addOption(
_optionDNameCountry,
_optionCountry,
help: 'Certificate info: Your country name',
mandatory: true,
);
Expand All @@ -56,18 +56,17 @@ class AndroidCreateKeyStoreCommandConfig
AndroidCreateKeyStoreConfigData parseResult(ArgResults? argResults) =>
AndroidCreateKeyStoreConfigData(
configNames: argResults.getRequiredOption(_optionConfigName),
dNameFullName: argResults.getRequiredOptionOrAskInput<String>(
_optionDNameFullName, 'Enter your Full Name'),
dNameOrganization: argResults.getRequiredOptionOrAskInput<String>(
_optionDNameOrganization, 'Enter your Organization'),
dNameOrganizationUnit: argResults.getOptionOrAskInput<String>(
_optionDNameOrganizationUnit,
'Enter your Oranization Unit (optional)'),
dNameCity: argResults.getOptionOrAskInput<String>(
_optionDNameCity, 'Enter your City (optional)'),
dNameState: argResults.getOptionOrAskInput(
_optionDNameState, 'Enter your State (optional)'),
dNameCountry: argResults.getRequiredOptionOrAskInput(
_optionDNameCountry, 'Enter the Country'),
fullName: argResults.getRequiredOptionOrAskInput<String>(
_optionFullName, 'Enter your Full Name'),
organization: argResults.getRequiredOptionOrAskInput<String>(
_optionOrganization, 'Enter your Organization'),
organizationUnit: argResults.getOptionOrAskInput<String>(
_optionOrganizationUnit, 'Enter your Oranization Unit (optional)'),
city: argResults.getOptionOrAskInput<String>(
_optionCity, 'Enter your City (optional)'),
state: argResults.getOptionOrAskInput(
_optionState, 'Enter your State (optional)'),
country: argResults.getRequiredOptionOrAskInput(
_optionCountry, 'Enter the Country'),
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:impaktfull_cli/src/core/command/config/command_config.dart';

class AndroidCreateKeyStoreConfigData extends ConfigData {
final List<String> configNames;

final String? fullName;
final String? organization;
final String? organizationUnit;
final String? city;
final String? state;
final String? country;

const AndroidCreateKeyStoreConfigData({
required this.configNames,
required this.fullName,
required this.organization,
required this.organizationUnit,
required this.city,
required this.state,
required this.country,
});
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ class KeyStoreCredentials {
final String keyAlias;
final Secret password;

final String? dNameFullName;
final String? dNameOrganization;
final String? dNameOrganizationUnit;
final String? dNameCity;
final String? dNameState;
final String? dNameCountry;
final String? fullName;
final String? organization;
final String? organizationUnit;
final String? city;
final String? state;
final String? country;

KeyStoreCredentials({
required this.name,
required this.storeFile,
required this.keyAlias,
required this.password,
required this.dNameFullName,
required this.dNameOrganization,
required this.dNameOrganizationUnit,
required this.dNameCity,
required this.dNameState,
required this.dNameCountry,
required this.fullName,
required this.organization,
required this.organizationUnit,
required this.city,
required this.state,
required this.country,
});

String? get dName {
final dNameItems = [
dNameFullName == null ? null : "cn=$dNameFullName",
dNameOrganization == null ? null : "o=$dNameOrganization",
dNameOrganizationUnit == null ? null : "ou=$dNameOrganizationUnit",
dNameCity == null ? null : "l=$dNameCity",
dNameState == null ? null : "st=$dNameState",
dNameCountry == null ? null : "c=$dNameCountry",
fullName == null ? null : "cn=$fullName",
organization == null ? null : "o=$organization",
organizationUnit == null ? null : "ou=$organizationUnit",
city == null ? null : "l=$city",
state == null ? null : "st=$state",
country == null ? null : "c=$country",
].whereType<String>();
if (dNameItems.isEmpty) return null;
return dNameItems.join(', ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class AndroidCreateKeyStorePlugin extends ImpaktfullCliPlugin {

Future<KeyStoreCredentials> createKeyStore({
required String name,
String? dNameFullName,
String? dNameOrganization,
String? dNameOrganizationUnit,
String? dNameCity,
String? dNameState,
String? dNameCountry,
String? fullName,
String? organization,
String? organizationUnit,
String? city,
String? state,
String? country,
}) async {
final alias = 'android';
final keystoreFile = File(join('android', 'keystore', '$name.keystore'));
Expand All @@ -36,12 +36,12 @@ class AndroidCreateKeyStorePlugin extends ImpaktfullCliPlugin {
storeFile: keystoreFile,
password: Secret.random(),
keyAlias: alias,
dNameFullName: dNameFullName,
dNameOrganization: dNameOrganization,
dNameOrganizationUnit: dNameOrganizationUnit,
dNameState: dNameState,
dNameCity: dNameCity,
dNameCountry: dNameCountry,
fullName: fullName,
organization: organization,
organizationUnit: organizationUnit,
state: state,
city: city,
country: country,
);
await processRunner.runProcess([
'keytool',
Expand Down

0 comments on commit 91039b6

Please sign in to comment.