INNER CODE UNIT · JavaScript

rmrf

agent-sh/agentsys · lib/binary/index.js:389

function rmrf(dir) {
  try {
    fs.rmSync(dir, { recursive: true, force: true });
  } catch (e) {
    /* ignore */
  }
}

// ---------------------------------------------------------------------------
// Extraction
// ---------------------------------------------------------------------------

/**
 * Extract a tar.gz buffer into a scratch directory, validating entries first.
 * Returns the scratch directory; caller is responsible for moving files out
 * and calling rmrf() on it.
 * @param {Buffer} buf
 * @returns {Promise<string>} scratch dir

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…