Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advice on project directory naming rule on creating_a_folder_for_your_project tutorial #984

Open
yskelg opened this issue Jul 6, 2023 · 2 comments

Comments

@yskelg
Copy link

yskelg commented Jul 6, 2023

Would it be better to advice on project directory names for those just starting out? I'm guessing that there are someone naming project directory wrong.

bootstrap:
# ...
        $(eval p := $(PROJECT))
        $(if $(shell echo $p | LC_ALL=C grep -x "[a-z0-9_]*"),,\
                $(error Error: Invalid characters in the application name))

bootstrap-lib:
# ...
        $(eval p := $(PROJECT))
        $(if $(shell echo $p | LC_ALL=C grep -x "[a-z0-9_]*"),,\
                $(error Error: Invalid characters in the application name))

For example,

~/erlang/hello-erlang-mk$ make -f erlang.mk bootstrap
...
make[1]: Leaving directory '/home/emniuyk/erlang/hello-erlang-mk/.erlang.mk.build'
cp .erlang.mk.build/erlang.mk ./erlang.mk
rm -rf .erlang.mk.build
erlang.mk:5458: *** Error: Invalid characters in the application name.  Stop.
@essen
Copy link
Member

essen commented Jul 6, 2023

Perhaps. Patch welcome!

@yskelg
Copy link
Author

yskelg commented Jul 7, 2023

OK, Project names are allowed only alphabet, numbers and _

$ cat test.txt
hello
hello()
hello-
hello_
3hello

# Allowed naming keyword are shown.
$ grep -x "[a-z0-9_]*" test.txt 
hello
hello_
3hello

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants