How to use untildify - 10 common examples

To help you get started, we’ve selected a few untildify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amazeeio / lagoon / cli / src / cli / promptUntilValidKeyPath.js View on Github external
export async function promptUntilValidKeyPath(
  cerr: typeof console.error,
): Promise {
  const { privateKeyPath } = await inquirer.prompt([
    {
      type: 'input',
      name: 'privateKeyPath',
      message: 'Path to private key file',
      // TODO: Move the fileExists validation logic to this object under the validate key to fail earlier
    },
  ]);

  if (
    !(await fileExists(
      // Expand tilde characters in paths
      untildify(privateKeyPath),
    ))
  ) {
    printErrors(cerr, { message: 'File does not exist at given path!' });
    return promptUntilValidKeyPath(cerr);
  }
  return privateKeyPath;
}
github crucialfelix / supercolliderjs / packages / lang / src / sclang.ts View on Github external
sclangConfigOptions(options: SCLangOptions): SCLangConf {
    const runtimeIncludePaths = [path.resolve(__dirname, "./supercollider-js")];

    const defaultConf: SCLangConf = {
      postInlineWarnings: false,
      includePaths: [],
      excludePaths: [],
    };
    let conf = defaultConf;

    if (options.sclang_conf) {
      try {
        conf = yaml.safeLoad(fs.readFileSync(untildify(options.sclang_conf), "utf8"));
      } catch (e) {
        // By default allow a missing sclang_conf file
        // so that the language can create it on demand if you use Quarks or LanguageConfig.
        if (!options.failIfSclangConfIsMissing) {
          // Was the sclang_conf just in the defaults or was it explicitly set ?
          this.log.dbug(e);
          conf = defaultConf;
        } else {
          throw new Error("Cannot open or read specified sclang_conf " + options.sclang_conf);
        }
      }
    }

    return {
      includePaths: _.union(conf.includePaths, options.conf.includePaths, runtimeIncludePaths),
      excludePaths: _.union(conf.excludePaths, options.conf.excludePaths),
github appnexus / sicksync / src / remote / fs-helper.js View on Github external
addDir (message) {
        fs.mkdirs(untildify(message.destinationpath), (err) => {
            if (err) return this.emit(fsEvents.ADD_DIR_ERROR, err);

            this.emit(fsEvents.ADD_DIR, message.destinationpath);
        });
    }
github halohalospecial / atom-elmjutsu / lib / pipe-selections.js View on Github external
function getPreludePath() {
  let preludePath = atom.config.get('elmjutsu.evalPreludePath');
  if (!preludePath || preludePath.trim() === '') {
    preludePath = path.join(
      path.dirname(atom.config.getUserConfigPath()),
      'packages',
      'elmjutsu',
      'elm',
      'EvalPrelude.elm'
    );
  }
  return untildify(preludePath);
}
github electrode-io / electrode-native / ern-local-cli / src / commands / cauldron / add / file.ts View on Github external
  argv.coerce('localFilePath', p => untildify(p)).epilog(epilog(exports))
github othiym23 / packard / src / commands.js View on Github external
handler: argv => {
      const files = argv.files.map(untildify)
      const roots = (argv.R || []).map(untildify)
      log.silly('unpack', 'files', files)
      log.silly('unpack', 'roots', roots)

      commands.active = unpack(
        { files, roots, pattern: argv.P },
        argv.s,
        argv.archive && argv.archiveRoot && untildify(argv.archiveRoot),
        argv.playlist && untildify(argv.playlist)
      )
    }
  }
github apiaryio / dredd / packages / dredd / lib / reporters / HTMLReporter.js View on Github external
HTMLReporter.prototype.sanitizedPath = function sanitizedPath(
  path = './report.html',
) {
  const filePath = pathmodule.resolve(untildify(path));
  if (fs.existsSync(filePath)) {
    logger.warn(`File exists at ${filePath}, will be overwritten...`);
  }
  return filePath;
};
github expo / expo-cli / packages / expo-cli / src / commands / build / ios / credentials / prompt / promptForCredentials.js View on Github external
const _produceAbsolutePath = filePath => {
  const untildified = untildify(filePath.trim());
  return !path.isAbsolute(untildified) ? path.resolve(untildified) : untildified;
};
github wildbit / postmark-cli / src / handler / utils / FileHandling.ts View on Github external
public directoryExists(path: string): boolean {
    return existsSync(untildify(path));
  }

untildify

Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis

Popular untildify functions