diff --git a/src/Commands/Upgrade.php b/src/Commands/Upgrade.php index e2bb4fe3..7a8e7328 100644 --- a/src/Commands/Upgrade.php +++ b/src/Commands/Upgrade.php @@ -4,6 +4,7 @@ use Illuminate\Console\Command; use Knuckles\Camel\Camel; +use Knuckles\Scribe\Configuration\PathConfig; use Knuckles\Scribe\GroupedEndpoints\GroupedEndpointsFactory; use Knuckles\Scribe\Scribe; use Shalvah\Upgrader\Upgrader; @@ -102,7 +103,8 @@ protected function migrateToConfigFileSort() $this->info("We'll automatically import your current sorting into the config item `groups.order`."); $defaultGroup = config($this->configName.".default_group"); - $extractedEndpoints = GroupedEndpointsFactory::fromCamelDir($this->configName)->get(); + $pathConfig = new PathConfig($this->configName, $this->configName, true); + $extractedEndpoints = GroupedEndpointsFactory::fromCamelDir($pathConfig)->get(); $order = array_map(function (array $group) { return array_map(function (array $endpoint) { @@ -112,7 +114,7 @@ protected function migrateToConfigFileSort() $groupsOrder = array_keys($order); $keyIndices = array_flip($groupsOrder); - $userDefinedEndpoints = Camel::loadUserDefinedEndpoints(Camel::camelDir($this->configName)); + $userDefinedEndpoints = Camel::loadUserDefinedEndpoints(Camel::camelDir($pathConfig)); if ($userDefinedEndpoints) { foreach ($userDefinedEndpoints as $endpoint) { diff --git a/src/Extracting/ApiDetails.php b/src/Extracting/ApiDetails.php index 31186015..f00db788 100644 --- a/src/Extracting/ApiDetails.php +++ b/src/Extracting/ApiDetails.php @@ -36,7 +36,7 @@ public function __construct( ) { $this->markdownOutputPath = $pathConfig->getTemporaryDirectoryPath(); //.scribe by default // If no config is injected, pull from global. Makes testing easier. - $this->config = $config ?: new DocumentationConfig(config($pathConfig)); + $this->config = $config ?: new DocumentationConfig(config($pathConfig->getScribeConfigurationPath())); $this->baseUrl = $this->config->get('base_url') ?? config('app.url'); $this->preserveUserChanges = $preserveUserChanges;