Browse files

Updating expect script to be more awesome.

  • Loading branch information...
1 parent b8bdd28 commit bdebf676ed9dfa10498e8cfa500af81127892d7f @cowboy cowboy committed Oct 2, 2012
Showing with 17 additions and 18 deletions.
  1. +17 −18 dev/init.exp
View
35 dev/init.exp
@@ -12,7 +12,7 @@ if {$argc == 0} {
foreach template $templates {
-set project "grunt-$template-example"
+set project "grunt-init-$template-sample"
# Disable git pushing when debugging.
set gitpush 1
@@ -62,9 +62,8 @@ expect "Please answer the following:"
# Loop over all prompts.
expect {
"Do you need to make any changes to the above before continuing? (y/N)" {send "\r"}
- "Project name (jquery.grunt-jquery-example)" {send "jquery.grunt-example\r"; exp_continue}
- "Project title (jQuery Grunt Example)" {send "Grunt jQuery Example Plugin\r"; exp_continue}
- "Description" {send "This is example output generated by the \"grunt init:$template\" task."; exp_continue}
+ "Project name (grunt-init-jquery-sample)" {send "grunt-sample\r"; exp_continue}
+ "Project title (Grunt Sample)" {send "Sample Grunt jQuery Plugin\r"; exp_continue}
") " {send "\r"; exp_continue}
}
@@ -84,20 +83,20 @@ send "tree\r"
expect "$ "
send "git add .\r"
expect "$ "
-send "git commit -m 'Committing example \"grunt init:$template\" task output.'\r"
+send "git commit -m 'Committing sample \"grunt init:$template\" task output.'\r"
# Session logging stops here.
expect "$ "
send "# EOF\n"
# Add meta-content to the README.
expect "$ "
-send "echo -e '# Grunt \"init:$template\" example
+send "echo -e '# Grunt \"init:$template\" sample
-This is example output generated by the \"grunt init:$template\" task.
+This is sample output generated by the \"grunt init:$template\" task.
_Note: this repository was generated dynamically using $version. Instead of
-reporting issues here, please report any issues with this repository as
+reporting issues here, please report any issues with this init template as
\[grunt issues\]\[issues\]. Instead of watching or forking this repository,
watch \[grunt\]\[grunt\] and use the grunt \[init task\]\[init\]._
@@ -106,43 +105,43 @@ The following is a transcript of the session in which this project and
repository were created. This is not actually a part of the \[grunt\]\[grunt\]
\"init:$template\" template, this session transcript was added afterwards. The
text after the `$` are the commands that were executed, and everything else is
-program output. If you want to see the repository exactly as it was created by
-grunt, view \[the previous commit\]\[prev\].' > README.md\r"
+program output.
+
+**If you want to see the repository exactly as it was created by grunt, \[view
+the \"generated\" branch\]\[prev\].**' > README.md\r"
expect "$ "
send "echo -e '
-Want to learn more? Check \[grunt\]\[grunt\] out.
\[grunt\]: http://gruntjs.com/
\[issues\]: https://github.com/gruntjs/grunt/issues
\[init\]: https://github.com/gruntjs/grunt/blob/master/docs/task_init.md
\[expect\]: https://github.com/gruntjs/grunt/blob/master/dev/init.exp
-\[prev\]: https://github.com/gruntjs/$project/tree/HEAD~1
+\[prev\]: https://github.com/gruntjs/$project/tree/generated
Note that this entire build process is automated by a rather complex \[expect
script\]\[expect\], which is used to automate grunt in order to facilitate the
-creation of this and other \[init task\]\[init\] example repositories.
+creation of this and other \[init task\]\[init\] sample repositories.
```' >> README.md\r"
expect "$ "
# Strip out everything before the "mkdir" and after the "EOF". Also remove any "--no-color" bits.
send "cat /tmp/grunt-expect-out | perl -ne's/ --no-color//;if(/^\\\$ mkdir/){\$x=1}elsif(/^\\\$ # EOF/){\$x=0}\$x&&print\$_' >> README.md\r"
expect "$ "
send "echo -e '```
-
-## License
-Copyright (c) 2012 \"Cowboy\" Ben Alman
-Licensed under the MIT license.' >> README.md\r"
+' >> README.md\r"
# Commit again.
expect "$ "
+send "git branch generated\r"
+expect "$ "
send "git add .\r"
expect "$ "
send "git commit -m 'Adding project creation transcript.'\r"
# Push to GitHub.
if {$gitpush} {
expect "$ "
- send "git push -uf origin master\r"
+ send "git push -uf --all origin\r"
}
expect "$ "

0 comments on commit bdebf67

Please sign in to comment.