From 0fa87a7708180af345d7bbb32bb86240d4c8c398 Mon Sep 17 00:00:00 2001 From: Matthew Batchelder Date: Mon, 25 May 2020 10:21:49 -0400 Subject: [PATCH] Fixing straggler dev/ issues --- src/commands/using.php | 2 +- src/tric.php | 4 ++-- src/utils.php | 13 ------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/commands/using.php b/src/commands/using.php index 7bea044..82e0c09 100644 --- a/src/commands/using.php +++ b/src/commands/using.php @@ -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; } diff --git a/src/tric.php b/src/tric.php index 394faeb..5dbb083 100644 --- a/src/tric.php +++ b/src/tric.php @@ -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 ); @@ -366,7 +366,7 @@ function tric_info() { ]; echo colorize( "Configuration read from the following files:\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, diff --git a/src/utils.php b/src/utils.php index 1b583b7..c5c82df 100644 --- a/src/utils.php +++ b/src/utils.php @@ -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, '\\/' ); -}