@profullstack/threatcrush 0.13.17 → 0.13.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -35088,6 +35088,9 @@ function looksLikeNodeScript(path) {
35088
35088
  function execStartCommand(binPath, nodePath, isNodeScript) {
35089
35089
  return isNodeScript ? `${nodePath} ${binPath} daemon` : `${binPath} daemon`;
35090
35090
  }
35091
+ function renderUnit(template, opts) {
35092
+ return template.replaceAll("{{BIN_PATH}} daemon", opts.exec).replaceAll("{{BIN_PATH}}", opts.binPath).replaceAll("{{CONFIG_DIR}}", opts.configDir);
35093
+ }
35091
35094
  function nodeVersionDir(path) {
35092
35095
  const m = path.match(
35093
35096
  /^(.*?\/(?:installs\/node(?:js)?|\.nvm\/versions\/node|node-versions|tools\/image\/node|n\/versions\/node)\/[^/]+)\//
@@ -35197,7 +35200,7 @@ async function installServiceCommand() {
35197
35200
  }
35198
35201
  const exec = execStartCommand(binPath, nodePath, isNodeScript);
35199
35202
  const configDir = (0, import_node_path22.join)((0, import_node_os10.homedir)(), ".threatcrush");
35200
- const unit = resolveTemplate().replace("{{BIN_PATH}} daemon", exec).replace("{{BIN_PATH}}", binPath).replace("{{CONFIG_DIR}}", configDir);
35203
+ const unit = renderUnit(resolveTemplate(), { exec, binPath, configDir });
35201
35204
  (0, import_node_fs32.writeFileSync)(UNIT_PATH, unit, { mode: 420 });
35202
35205
  console.log(source_default.green(` \u2713 Installed unit file: ${UNIT_PATH}`));
35203
35206
  console.log(source_default.dim(` ExecStart=${exec}`));