ensureGameDirectory() {
    try {
      if (!fs.statSync(this.gameDirectoryPath).isDirectory()) {
        throw new GameError(
          'A file named warriorjs exists at this location. Please change the directory under which you are running warriorjs.',
        );
      }
    } catch (err) {
      if (err.code !== 'ENOENT') {
        throw err;
      }

      fs.mkdirSync(this.gameDirectoryPath);
    }
  }
/**
   * Ensures the game directory exists.
   */
Ensures the game directory exists.
Ensures the game directory exists .
ensureGameDirectory() {
    try {
      if (!fs.statSync(this.gameDirectoryPath).isDirectory()) {
        throw new GameError(
          'A file named warriorjs exists at this location. Please change the directory under which you are running warriorjs.',
        );
      }
    } catch (err) {
      if (err.code !== 'ENOENT') {
        throw err;
      }
      fs.mkdirSync(this.gameDirectoryPath);
    }
  }
ensureGameDirectory ( ) { try { if ( ! fs . statSync ( this . gameDirectoryPath ) . isDirectory ( ) ) { throw new GameError ( 'A file named warriorjs exists at this location. Please change the directory under which you are running warriorjs.' , ) ; } } catch ( err ) { if ( err . code !== 'ENOENT' ) { throw err ; } fs . mkdirSync ( this . gameDirectoryPath ) ; } }
Ensures the game directory exists.
Ensures the game directory exists .