Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Elm make generates broken build if repo name contains dots #190

Open
Leden opened this issue Mar 20, 2018 · 1 comment
Open

Elm make generates broken build if repo name contains dots #190

Leden opened this issue Mar 20, 2018 · 1 comment

Comments

@Leden
Copy link

Leden commented Mar 20, 2018

For example, "repository": "https://github.com/leden/lesnov.me.git" would be a completely valid repo name for Github, but as Elm make uses this piece to generate function names without sanitizing it first, it seems, the following happens:

// ...
var Elm = {};
Elm['Main'] = Elm['Main'] || {};
if (typeof _leden$lesnov.me$Main$main !== 'undefined') {
    _leden$lesnov.me$Main$main(Elm['Main'], 'Main', undefined);
}
// ...

See how the dot sneaked into the expression and ruined it?

When trying to run it, the following error happens:

Uncaught ReferenceError: runElmProgram is not defined
    at Main.elm:10
(anonymous) @ Main.elm:10

Should do some basic sanitization on such parameters, I think, and either fail loudly and ask the user to rename the repo, or escape dots and other possible trash silently. What do you think?

UPD:
Some details on my report to comply with the checklist:
My OS is Ubuntu Xenial 16.04.4
The browser is Chromium 64.0.3282.167 (Official Build) Built on Ubuntu, running on Ubuntu 16.04 (64-bit)

$ elm --version
0.18.0
@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

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

No branches or pull requests

2 participants