coderaiser / minify

Minifier of js, css, html and img
https://coderaiser.github.io/minify
MIT License
228 stars 29 forks source link

Use heredoc sytax to create hello.js in the README.md #58

Closed gnanet closed 4 years ago

gnanet commented 4 years ago

The more simple way for creating a hello.js is to use here-doc syntax, and avoid to instruct the user to enter some control+key stuff:

Instead of this:

The bash command below prompts the user to enter a code snippet to be saved in "hello.js".

Press <enter> after the closing } and then either ^D or ^C to finish the prompt.

$ cat > hello.js
const hello = 'world';

for (let i = 0; i < hello.length; i++) {
    console.log(hello[i]);
}
^D

That paragraph could be this:

The bash command below creates a code snippet saved as "hello.js".

Simply copy + paste the code starting with cat, including the EOT on the last line, and press <enter>.

$ cat <<EOT > hello.js
const hello = 'world';

for (let i = 0; i < hello.length; i++) {
    console.log(hello[i]);
}
EOT
coderaiser commented 4 years ago

Nice addition, feel free to make PR with this 👍

coderaiser commented 4 years ago

Thanks a lot :), landed to v6.0.0 🎉 .

gnanet commented 4 years ago

@coderaiser oh shit, i created a PR on my fork from the change-branch to the master :man_facepalming:

myfault