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

Commit

Permalink
Merge pull request #101 from zainab-ali/v4
Browse files Browse the repository at this point in the history
WIP: Improve error messaging for invalid recipe files
  • Loading branch information
akirak authored Jul 20, 2021
2 parents 4a127c8 + 255be2e commit bb64b07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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 =
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

0 comments on commit bb64b07

Please sign in to comment.