Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

WIP: Improve error messaging for invalid recipe files #101

Merged
merged 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/elinter
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ else
fi

usage() {
# Follow the style in docopt https://docopt.org/
# Follow the style in docopt http://docopt.org/
cat <<HELP
Usage: elinter [options] <recipe>...

Expand Down Expand Up @@ -273,6 +273,7 @@ copy_package_sources() {
initialdir="$(pwd)"
# Operate on each package recipe
for f in ${recipes[*]}; do
echo "Linking package source files for recipe ${f} ..."
# Use the base name of the recipe file as the package name
package=$(basename "$f")
# Convert to an absolute path
Expand Down
6 changes: 5 additions & 1 deletion nix/copySource.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ let
filter (file: match "(.*/)?flycheck_.+\.el" file == null)
(expandPackageFiles srcRoot recipeAttrs.files);
sourceFiles = filter isElisp packageFiles;
mainFiles = (filter isMainFile sourceFiles);
mainFile =
akirak marked this conversation as resolved.
Show resolved Hide resolved
if length sourceFiles == 1
then head sourceFiles
else head (filter isMainFile sourceFiles);
else
if mainFiles == [ ]
then abort "Main elisp file not found for recipe ${recipeFile}."
else head mainFiles;
};
in
with package;
Expand Down