Skip to content

Commit

Permalink
use command for publishing supersake file so the test passes
Browse files Browse the repository at this point in the history
  • Loading branch information
axyr committed Apr 18, 2016
1 parent 57acb7f commit 4409a54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -12,7 +12,7 @@ matrix:
- php: 7.0
script:
- php framework/cli-script.php dev/build
- php framework/cli-script.php console/publish
- php framework/cli-script.php console console:publish
- vendor/bin/phpunit console/tests/
env:
matrix:
Expand Down
24 changes: 12 additions & 12 deletions code/Commands/Make/MakeCommand.php
Expand Up @@ -206,47 +206,47 @@ protected function getTargetDirectoryByOptionOrConfig()
/**
* @return string
*/
protected function getStubFilePath($commandClass)
protected function getStubFilePath($stubName)
{
$customStubFilePath = $this->getCustomStubPath($commandClass);
$customStubFilePath = $this->getCustomStubPath($stubName);
if (is_file($customStubFilePath)) {
return $customStubFilePath;
}

$mysiteStubFilePath = $this->getCustomStubPath($commandClass);
$mysiteStubFilePath = $this->getCustomStubPath($stubName);

if (is_file($mysiteStubFilePath)) {
return $mysiteStubFilePath;
}

return $this->getConsoleStubPath($commandClass);
return $this->getConsoleStubPath($stubName);
}

/**
* @return string
*/
protected function getConsoleStubPath($commandClass)
protected function getConsoleStubPath($stubName)
{
return BASE_PATH.'/console/stubs/'.$commandClass.'.php.stub';
return BASE_PATH.'/console/stubs/'.$stubName.'.php.stub';
}

/**
* @return string
*/
protected function getMySiteStubPath($commandClass)
protected function getMySiteStubPath($stubName)
{
return BASE_PATH.'/mysite/stubs/'.$commandClass.'.php.stub';
return BASE_PATH.'/mysite/stubs/'.$stubName.'.php.stub';
}

/**
* @return string
*/
protected function getCustomStubPath($commandClass)
protected function getCustomStubPath($stubName)
{
$stubDir = Config::inst()->get('MakeCommand', 'stub_dir');

if ($stubDir) {
return BASE_PATH.'/'.$stubDir.'/'.$commandClass.'.php.stub';
return BASE_PATH.'/'.$stubDir.'/'.$stubName.'.php.stub';
}

return '';
Expand All @@ -272,7 +272,7 @@ protected function classExists($class)
$loader = SS_ClassLoader::instance();
$exists = $loader->classExists($class);
$path = $loader->getItemPath($class);

return $exists && is_file($path);
}

Expand Down Expand Up @@ -315,7 +315,7 @@ protected function getNameInput()
protected function getOptions()
{
return [
['clearcache', 'c', InputOption::VALUE_NONE, 'Clear the cache after adding the class'],
['clearcache', 'cc', InputOption::VALUE_NONE, 'Clear the cache after adding the class'],
['dir', 'd', InputOption::VALUE_OPTIONAL, 'Set the directory to write the file to'],
];
}
Expand Down

0 comments on commit 4409a54

Please sign in to comment.