Skip to content

Commit a8e7bd1

Browse files
committed
Merge branch 'kirtangajjar-sudo-at-entrypoint' into develop-v4
2 parents 654dd06 + 9eb7adb commit a8e7bd1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

php/EE/Runner.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ public function init_logger() {
482482

483483
// Create the config directory if not exist for file logger to initialize.
484484
if ( ! is_dir( EE_CONF_ROOT ) ) {
485-
shell_exec('sudo mkdir -p ' . EE_CONF_ROOT);
485+
shell_exec('mkdir -p ' . EE_CONF_ROOT);
486486
}
487487

488488
if ( ! is_writable( EE_CONF_ROOT ) ) {
489-
EE::err( 'Please run `ee` with root privileges.' );
489+
EE::err( 'Config root: ' . EE_CONF_ROOT . ' is not writable by EasyEngine' );
490490
}
491491

492492
if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) {
@@ -548,7 +548,7 @@ public function init_config() {
548548
array_unshift( $args, 'cli' );
549549
unset( $assoc_args['version'] );
550550
}
551-
551+
552552
// ee3 backward compatibility to wp-cli flags
553553
$wp_compat_array_map = array(
554554
'user' => 'admin_user',
@@ -624,7 +624,7 @@ private function ensure_present_in_config( $var, $default) {
624624
$this->add_var_to_config_file( $var, $config_file_path );
625625
return;
626626
}
627-
EE::err("Please run `ee` with root privileges.");
627+
EE::err("Configuration directory: $config_dir_path is not writable by EasyEngine.");
628628
}
629629
}
630630
}

php/init-ee.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
if( posix_geteuid() ) {
4+
echo "\033[1;31mError:\033[0m Please run `ee` with root privileges.";
5+
return;
6+
}
7+
38
// Can be used by plugins/themes to check if EE is running or not
49
define( 'EE', true );
510
define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) );

0 commit comments

Comments
 (0)