From ebcebdecf74aab010342e6b024d0cb7b7ffa7eec Mon Sep 17 00:00:00 2001 From: Pierre Chanson Date: Fri, 24 Jan 2020 09:59:27 +0100 Subject: [PATCH] Apply the configuration once we read it. fixes #4 --- .../CinicCommandLineHandler.class/instance/activate.st | 2 +- .../instance/createConfigurationFromFile.st | 5 ----- .../instance/readConfigurationAndApply.st | 6 ++++++ 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 Cinic-Core.package/CinicCommandLineHandler.class/instance/createConfigurationFromFile.st create mode 100644 Cinic-Core.package/CinicCommandLineHandler.class/instance/readConfigurationAndApply.st diff --git a/Cinic-Core.package/CinicCommandLineHandler.class/instance/activate.st b/Cinic-Core.package/CinicCommandLineHandler.class/instance/activate.st index c96366b..aa9d551 100644 --- a/Cinic-Core.package/CinicCommandLineHandler.class/instance/activate.st +++ b/Cinic-Core.package/CinicCommandLineHandler.class/instance/activate.st @@ -2,7 +2,7 @@ validation activate self activateHelp ifTrue: [ ^ self ]. self validateConfigurationFile. - self createConfigurationFromFile. + self readConfigurationAndApply. (self hasOption: 'save') ifTrue: [ Smalltalk snapshot: true andQuit: false ]. self exitSuccess \ No newline at end of file diff --git a/Cinic-Core.package/CinicCommandLineHandler.class/instance/createConfigurationFromFile.st b/Cinic-Core.package/CinicCommandLineHandler.class/instance/createConfigurationFromFile.st deleted file mode 100644 index c256014..0000000 --- a/Cinic-Core.package/CinicCommandLineHandler.class/instance/createConfigurationFromFile.st +++ /dev/null @@ -1,5 +0,0 @@ -validation -createConfigurationFromFile - | file cinicConfig | - file := self firstJsonFileArgument. - cinicConfig := Cinic readFileNamed: file asFileReference. \ No newline at end of file diff --git a/Cinic-Core.package/CinicCommandLineHandler.class/instance/readConfigurationAndApply.st b/Cinic-Core.package/CinicCommandLineHandler.class/instance/readConfigurationAndApply.st new file mode 100644 index 0000000..0fb4ac5 --- /dev/null +++ b/Cinic-Core.package/CinicCommandLineHandler.class/instance/readConfigurationAndApply.st @@ -0,0 +1,6 @@ +validation +readConfigurationAndApply + | file cinicConfig | + file := self firstJsonFileArgument. + cinicConfig := Cinic readFileNamed: file asFileReference. + cinicConfig apply \ No newline at end of file