Commit graph

10 commits

Author SHA1 Message Date
Jeff Kowalski
29e30e8af4 fix(cli): follow-on syntax fixes to #6772
While fixing #6772, we also address several other issues found by
sh-shellcheck:

L47C39 SC1007:Remove space after = if trying to assign a value
(for empty string, use var='' ... ).

L47C46 SC2046:Quote this to prevent word splitting.

L62C20 SC2086:Double quote to prevent globbing and word splitting.

L82C9  SC2154:tmpdir is referenced but not assigned
(did you mean 'TMPDIR'?).
2022-09-12 11:44:11 +02:00
Jeff Kowalski
571ab7425a fix(cli): #6772 - trivial doomscripts fail
When trying to establish the value of EMACSDIR, the proper fallback
when BASH_SOURCE is undefined is $0 rather than 0, in correct shell-
scripting parlance.
2022-09-12 11:44:11 +02:00
Henrik Lissner
0172b180a9
refactor(cli): remove superfluous emacs switches
Neither --no-x-resources or --no-splash are relevant to a noninteractive
session.
2022-09-07 17:25:01 +02:00
Henrik Lissner
0100b08402
refactor(cli): handle more errors & POSIX-ify doomscript 2022-09-06 22:55:48 +02:00
Henrik Lissner
b9933e6637
refactor!: restructure Doom core
BREAKING CHANGE: This restructures the project in preparation for Doom
to be split into two repos. Users that have reconfigured Doom's CLI
stand a good chance of seeing breakage, especially if they've referred
to any core-* feature, e.g.

  (after! core-cli-ci ...)

To fix it, simply s/core-/doom-/, i.e.

  (after! doom-cli-ci ...)

What this commit specifically changes is:
- Renames all core features from core-* to doom-*
- Moves core/core-* -> lisp/doom-*
- Moves core/autoloads/* -> lisp/lib/*
- Moves core/templates -> templates/

Ref: #4273
2022-07-30 22:41:13 +02:00
Henrik Lissner
4dcfc37199
nit(cli): clarify comments in bin/doomscript 2022-06-22 23:04:59 +02:00
Henrik Lissner
3ea9051890
fix(cli): remove set -e from bin/doom{,script}
This killed the script prematurely (without displaying the error) if
Emacs failed to execute. In versions prior to bash 4, set -e would not
terminate the script if a non-zero exit code occurred within a subshell,
but it will in bash 4+.

In any case, we don't need this fallback to begin with. The script
handles its errors sufficiently otherwise.
2022-06-22 01:23:39 +02:00
Henrik Lissner
3b3c008b1b
fix(cli): site file loader
I had missed the fact that -Q implies not only
--no-site-file (intended), but --no-site-lisp (unintended). Without the
latter, no site-lisp directory is left in load-path, and any attempt to
load it after-the-fact (which I do in core-cli.el) will fail. Thanks to
@yamanq for noticing this!

Fix: #6473
Fix: #4198
Co-authored-by: Yaman Qalieh <yamanq@users.noreply.github.com>
2022-06-21 22:48:43 +02:00
Henrik Lissner
09ddac1d7a
feat(cli): resolve EMACSDIR to doomscript's parent directory
If no EMACSDIR is given, assume ../ is the Emacs config we want to
operate out of, taking after bin/doom.

And use bash. This script was designed for the convenience of other
scripters on unix systems, so it can afford a small hit to portability.
2022-06-19 02:20:34 +02:00
Henrik Lissner
e5b7edcd8d
feat(cli): add bin/doomscript
Meant as a simple elisp interpreter with Doom's CLI framework preloaded.
Can be used as a shebang line:

  #!/usr/bin/env doomscript
  (princ "hello world!")

This isn't used for bin/doom because it requires doomscript be in your
$PATH, and any attempt to resolve its location in bin/doom's shebang
line would reduce its portability. Neither of these should be an issue
for the type of user who'd find this useful.
2022-06-18 23:53:12 +02:00