]> Lady’s Gitweb - HOMEDIR/commitdiff
Support Swift 0.2.0
authorLady <redacted>
Sun, 5 Apr 2026 19:49:50 +0000 (15:49 -0400)
committerLady <redacted>
Sun, 5 Apr 2026 20:06:54 +0000 (16:06 -0400)
The Swift compiler uses Git internally, and it breaks with the
  modifications to Git provided by this repository.
So it is important to call it with the default implementation of Git,
  which is achieved by resetting the `PATH´.

There may be other programs in this boat as well.

Message-type: text/lesml

bin/swift [new symlink]
sh/with-default-path.sh [new file with mode: 0755]

diff --git a/bin/swift b/bin/swift
new file mode 120000 (symlink)
index 0000000..b5197ed
--- /dev/null
+++ b/bin/swift
@@ -0,0 +1 @@
+../sh/with-default-path.sh
\ No newline at end of file
diff --git a/sh/with-default-path.sh b/sh/with-default-path.sh
new file mode 100755 (executable)
index 0000000..95ae443
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/env sh
+# @(#)🏠📂 HOMEDIR       sh/with-default-path.sh 2026-04-05T19:49:50Z
+# SPDX-FileCopyrightText: 2026 Lady <https://www.ladys.computer/about/#lady>
+# SPDX-License-Identifier: MPL-2.0
+
+## ⁌ With Default Path
+##
+## ∎ Copyright © 2026 Lady [@ Ladys Computer].
+##
+## ⋮ This Source Code Form is subject to the terms of the Mozilla
+##   Public License, version 2.0.
+## If a copy of the M·P·L was not distributed with this file, You can
+##   obtain one at {🔗<https://mozilla.org/MPL/2.0/>}.
+
+## § Description
+##
+## Some programs break with the `git´ customizations provided by this
+##   repository, so it is important to reset the `PATH´ before calling
+##   them.
+## Symlinking such program names to this script provides the necessary
+##   `PATH´ override.
+
+set -o 'errexit'
+
+## § Configuration
+##
+## The following variables provide hooks to override the commands used
+##   by this script.
+
+: "${cmd_BASENAME:=basename}"
+
+## The program name defaults to the basename of the script as it is
+##   called.
+## This allows one to simply create a symlink of the appropriate name
+##   to this script rather than needing to configure anything
+##   explicitly.
+
+defaultprogramname="$(
+  "${cmd_BASENAME}" -- "$0"
+)"
+defaultprogram="$(
+  command -pv "${defaultprogramname}"
+)"
+: "${cmd_PROGRAM:=${defaultprogram}}"
+
+## § Implementation
+##
+## The implementation simply sets the `PATH´ appropriately (using the
+##   builtin version of `getconf´) and then calls the program name.
+## `${HOMEDIR}/.local/bin´ is added to the `PATH´ to provide a single
+##   point of extensibility for user‐level modifications; it is
+##   important that this not be used to override default
+##   implementations in cases where continued access to the latter is
+##   important.
+
+PATH='${HOMEDIR}/.local/bin:'"$(
+  command -p getconf PATH
+)" "${cmd_PROGRAM}" "$@"
This page took 0.296901 seconds and 4 git commands to generate.