Skip to content

Commit

Permalink
Fixing straggler dev/ issues
Browse files Browse the repository at this point in the history
  • Loading branch information
borkweb committed May 25, 2020
1 parent 4001638 commit 0fa87a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/commands/using.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

echo light_cyan( "Using {$using}\n" );

if ( tric_plugins_dir() !== root( 'plugins' ) ) {
if ( tric_plugins_dir() !== root( '_plugins' ) ) {
echo light_cyan( "\nFull target path: " ) . $target_path;
}

Expand Down
4 changes: 2 additions & 2 deletions src/tric.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function tric_target( $require = true ) {
* @param string $target Target to switch to.
*/
function tric_switch_target( $target ) {
$root = dirname( dirname( __DIR__ ) );
$root = root();
$run_settings_file = "{$root}/.env.tric.run";

write_env_file( $run_settings_file, [ 'TRIC_CURRENT_PROJECT' => $target ], true );
Expand Down Expand Up @@ -366,7 +366,7 @@ function tric_info() {
];

echo colorize( "<yellow>Configuration read from the following files:</yellow>\n" );
$tric_root = dirname( dirname( __DIR__ ) );
$tric_root = root();
echo implode( "\n", array_filter( [
file_exists( $tric_root . '/.env.tric' ) ? " - " . $tric_root . '/.env.tric' : null,
file_exists( $tric_root . '/.env.tric.local' ) ? " - " . $tric_root . '/.env.tric.local' : null,
Expand Down
13 changes: 0 additions & 13 deletions src/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,16 +503,3 @@ function ask( $question, $default = null ) {

return '' === $value ? $default : $value;
}

/**
* Returns the absolute path to the root directory.
*
* @param string $path An optional, relative path to append to the root directory absolute path.
*
* @return string The absolute path to the root directory.
*/
function root_dir( $path = '' ) {
$root = dirname( dirname( __DIR__ ) );

return empty( $path ) ? $root : $root . '/' . ltrim( $path, '\\/' );
}

0 comments on commit 0fa87a7

Please sign in to comment.