-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
bin/configure
could be broken up
#1440
Comments
Starting to take a look at what all happens in The first thing we do is make sure that a couple of utility gems are installed and required. Lines 3 to 12 in f4a32e7
Then we define several utility functions that we use later in the script. Lines 14 to 61 in f4a32e7
Then we check that the version of ruby on the local system matches what we expect. If we don't have the right version we don't just bail out automatically, we give the user the option to try to continue with whatever ruby version they're using. Lines 65 to 78 in f4a32e7
Next we check whether Lines 80 to 88 in f4a32e7
Now we start a Line 90 in f4a32e7
On Lines 91 to 94 in f4a32e7
Continuing with the OS Relying on Lines 95 to 132 in f4a32e7
To close out the OS Lines 133 to 144 in f4a32e7
Next we try to determine which version of Lines 146 to 164 in f4a32e7
Next we check for Lines 166 to 171 in f4a32e7
Next is a block that is currently commented out, with a note about uncommenting it. Should we have already done that? Lines 173 to 182 in f4a32e7
Next is a block where we ask you if you want to push your new project to GitHub. Lines 184 to 188 in f4a32e7
After asking about GitHub there's a long block where we do various things. First we try to change the name of the remote for the starter repo from Lines 190 to 199 in f4a32e7
Then comes a block where we pop open a web browser for you so you can create a new repo on GitHub. Once you've done that you're supposed to paste the Lines 201 to 219 in f4a32e7
Then to conclude the GitHub-repo-setup block we grab the name of your current branch, and then push it to your new repo as the Lines 221 to 224 in f4a32e7
After the GitHub stuff we then run Lines 227 to 231 in f4a32e7
Next we ask for the name of your application. Then we munge that to create a few variants ("My Test App" => "my_test_app" => "mytestapp" => etc...). Then we do string substitution in a bunch of files to replace instances of "Untitled Application" or "untitled_application" with the new values. Lines 233 to 265 in f4a32e7
Next up is a block that I don't think is ever run. Due to the way that we capture the Allegedly this block tries to change the repo link on the "deploy to render" button in Lines 269 to 273 in f4a32e7
Then we move Lines 275 to 276 in f4a32e7
Then we remove a file that is specific to the BT starter repo. There are probably a few more files we could remove here. Specifically some of the workflow files that are for internal core team processes. Line 278 in f4a32e7
Then we do one more string substitution. It's not clear to me why this one would need to happen after overwriting Lines 280 to 281 in f4a32e7
Now we have another block related to GitHub setup. Again the seeming intention here differs from what actually happens, again due to how
Lines 283 to 291 in f4a32e7
And finally we output some messages. Lines 293 to 297 in f4a32e7
I think broadly this script only does a few big-picture things, but they're currently kind of jumbled up in confusing ways.
I think ideally we should be able to separate these things out into a collection of smaller scripts ( It's also probably worth thinking about the order in which this all happens. For instance, is it really necessary to know that all the dependencies are installed before we do string substitution and setup GitHub? Is it realistic to to do the string substitution first, then GitHub, then local dependency checking? To put it a different way: Should you be blocked from starting a new app and pushing it to GitHub just because you don't have all of your local dependencies satisfied? (And satisfied via the package managers that we know how to interrogate?) |
All of the current open issues around #1435 - #1412 - #1388 - Repo link in README is not replaced #1116 - #1262 - Add Tunnelmole as an open source alternative to ngrok #814 - #515 - rails not found in bin/configure step |
The
bin/configure
script does a lot of things and it's not really possible (or at least not easy) to run only a portion of the script. It might be nice to extract the various pieces out into separate scripts that could be run individually.The biggest problem with the current arrangement is that we first do a lot of work to try to detect and install dependencies, before moving on to making changes to the app config and setting up git. We don't gracefully handle dependency detection on all systems, and when that fails it can end up blocking people from being able to finish making the config changes needed.
So, in addition to extracting the bits into separate scripts we might also revisit the order in which we run those individual scripts. We might want to do config tweaking first, and then move on to dependency installation.
Related to #1435
The text was updated successfully, but these errors were encountered: