Ensure a named directory exists.

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_ensure_dir

Purpose

Ensure a named directory exists.

Arguments

  • $1 — Directory path.

Side effects

Creates a missing directory and its parents.

Returns

  • 0 if present or created; 2 if the path is empty; otherwise mkdir status.

Usage

  sgnd_ensure_dir "/tmp/sgnd-demo"