Преглед на файлове

fix(system-executors): wrong usage of getEnv in start script

Nicolas Meienberger преди 1 година
родител
ревизия
24c4d0f8af
променени са 2 файла, в които са добавени 2 реда и са изтрити 16 реда
  1. 2 4
      packages/cli/src/executors/system/system.executors.ts
  2. 0 12
      packages/cli/src/index.ts

+ 2 - 4
packages/cli/src/executors/system/system.executors.ts

@@ -50,9 +50,7 @@ export class SystemExecutors {
     };
   };
 
-  private ensureFilePermissions = async () => {
-    const { rootFolderHost } = getEnv();
-
+  private ensureFilePermissions = async (rootFolderHost: string) => {
     console.log('Tipi is asking for your password to ensure file permissions are correct (performed only in runtipi folder)');
     const filesAndFolders = [
       path.join(rootFolderHost, 'apps'),
@@ -135,7 +133,7 @@ export class SystemExecutors {
   public start = async () => {
     const spinner = new TerminalSpinner('Starting Tipi...');
     try {
-      await this.ensureFilePermissions();
+      await this.ensureFilePermissions(this.rootFolder);
 
       spinner.start();
       spinner.setMessage('Copying system files...');

+ 0 - 12
packages/cli/src/index.ts

@@ -7,18 +7,6 @@ import { startWorker } from './services/watcher/watcher';
 import { SystemExecutors } from './executors';
 
 const main = async () => {
-  // Ensure the user is running as root
-  if (process.env.NODE_ENV === 'production' && (!process.getuid || process.getuid() !== 0 || !process.getgid || process.getgid() !== 0)) {
-    // console.error(chalk.red('✗'), 'Tipi CLI must be run as root');
-    // process.exit(1);
-  }
-
-  // Ensure the OS is linux
-  if (process.env.NODE_ENV === 'production' && process.platform !== 'linux') {
-    // console.error(chalk.red('✗'), 'Tipi CLI can only be run on Linux');
-    // process.exit(1);
-  }
-
   program.description(description).version(version);
 
   program