Files
pr-preview/node_modules/empathic/walk.mjs
T
space a71f801c3f feat: initial scaffold - backend, frontend, Prisma schema, Docker
- Prisma schema: User, Session, RepoConfig, Preview, Job, WebhookToken, NoConfigComment, AdminSettings
- Backend: auth (login/logout/me/first-user setup), webhook handler with HMAC verification, EC2 service, SSH service, deploy pipeline, job queue worker, cron workers
- Frontend: Login with first-user detection, Dashboard, PreviewDetail with live log streaming, Settings, Repos config, Admin panel, SetupWizard, Privacy page
- Docker Compose and Dockerfile for self-hosted deployment
- Uses bcryptjs for Node 24 compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:18:08 +02:00

21 lines
535 B
JavaScript

import { dirname } from "node:path";
import { absolute } from "empathic/resolve";
/**
* Get all parent directories of {@link base}.
* Stops after {@link Options['last']} is processed.
*
* @returns An array of absolute paths of all parent directories.
*/
export function up(base, options) {
let { last, cwd } = options || {};
let tmp = absolute(base, cwd);
let root = absolute(last || "/", cwd);
let prev, arr = [];
while (prev !== root) {
arr.push(tmp);
tmp = dirname(prev = tmp);
if (tmp === prev) break;
}
return arr;
}