diff --git a/commands/AlfredTime.class.php b/commands/AlfredTime.class.php index 35a83edd..e2e18727 100644 --- a/commands/AlfredTime.class.php +++ b/commands/AlfredTime.class.php @@ -122,7 +122,13 @@ private function loadConfiguration() private function saveConfiguration() { - $configFile = getenv('alfred_workflow_data') . '/config.json'; + $workflowDir = getenv('alfred_workflow_data'); + $configFile = $workflowDir . '/config.json'; + + if (file_exists($workflowDir) === false) { + mkdir($workflowDir); + } + file_put_contents($configFile, json_encode($this->config, JSON_PRETTY_PRINT)); }