Permalink
Browse files

closes #100; closes #103; added ability to fetch all strawberry perls…

… with the "brewbuild fetch all" command
  • Loading branch information...
stevieb9 committed Feb 16, 2018
1 parent cc99177 commit b2417dbc6b0a09c600bab696eb772f1afe70473f
Showing with 52 additions and 12 deletions.
  1. +6 −2 Changes
  2. +4 −1 README.md
  3. +15 −4 data/messages.json
  4. +7 −1 doc/Berrybrew API.md
  5. +5 −1 doc/berrybrew.md
  6. +13 −1 src/bbconsole.cs
  7. +2 −2 src/berrybrew.cs
View
@@ -7,8 +7,12 @@ Revision history for berrybrew
- fixed issue where the orphaned Perls that were installed prior to
using "fetch" weren't being registered as custom correctly (required
two calls to "fetch"). To fix, added new
PerlUpdateAvailableListOrphans()(closes #102; closes #99)
PerlUpdateAvailableListOrphans()(closes #102; closes #99) (Thanks
@pryrt for the notice!)
- added ability to fetch every single Perl version Strawberry has to
offer with the new "all" argument to "berrybrew fetch" (closes #100;
closes #103) (thanks @pryrt for the notice!)
1.17 2017-10-04
- task information displayed during install operation is now in logical
order (fixes #95)
View
@@ -68,7 +68,7 @@ will reside.
config Add berrybrew to your PATH
clean * Remove all temporary berrybrew files
clone Clones an installed version to a custom-named one
fetch Upgrade the list of Strawberry Perl instances available
fetch * Upgrade the list of Strawberry Perl instances available
install Download, extract and install a Strawberry Perl
register Manually register a custom installation directory
remove Uninstall a Strawberry Perl
@@ -241,6 +241,9 @@ Use `berrybrew fetch` to retrieve the most recent availability list from
Strawberry Perl. If any new or changed versions are found, we'll update the
local `perls.json` file with them.
If you supply the `all` subcommand to `berrybrew fetch`, we will load all
available Perls that Strawberry has to offer.
## Configure Root Directory
By default, we manage Perls out of the `C:\berrybrew` directory. To
View
@@ -139,7 +139,7 @@
" clone Make a complete copy of a Perl installation",
" config Add berrybrew to your PATH",
" exec * Run a command for every installed Strawberry Perl",
" fetch Update the list of Strawberry Perl instances available",
" fetch * Update the list of Strawberry Perl instances available",
" install Download, extract and install a Strawberry Perl",
" off Disable berrybrew perls (use 'switch' to re-enable)",
" register Manually register a custom installation directory",
@@ -206,7 +206,7 @@
"",
" temp Removes all downloaded Perl installation files",
" orphan Deletes all orphaned Perl installations",
" all Clean everything",
" all Clean everything"
]
},
{
@@ -221,6 +221,18 @@
" Execute a command across only select versions of Perl"
]
},
{
"label": "subcmd.fetch",
"content": [
"",
" berrybrew 'fetch' subcommands:",
"",
" all",
"",
" When fetching the updated Perl list, fetch all available versions."
]
},
{
"label": "subcmd.use",
@@ -244,8 +256,7 @@
"",
" Use the given version (or versions) of Perl temporarily,",
" with each new version spawning its own command window.",
" When done with a given version, type exit to close that window.",
" When done with a given version, type exit to close that window."
]
}
]
View
@@ -488,12 +488,18 @@ the corresponding object.
#### PerlUpdateAvailableList
public void PerlUpdateAvailableList()
public void PerlUpdateAvailableList(bool allPerls=false)
argument: allPerls
value: Bool
Fetches the JSON list of Strawberry Perl instances available from
[Strawberry's releases.json](https://strawberryperl.com/releases.json), and
updates the internal `perls.json` available list with the updated data.
If the `allPerls` bool is set to true, we will fetch all available Strawberry
Perl listings.
#### PerlUpdateAvailableListOrphans()
Automatically registered any orphaned Perls after using the `Fetch()` method. This
View
@@ -109,12 +109,16 @@ Also, by default, we don't execute on custom (cloned) instances. Set
#### fetch
Usage: `berrybrew fetch`
Usage: `berrybrew fetch [all]`
Pulls the JSON list of available Strawberry Perl instances from the Strawberry
website, and puts them into the `data/perls.json` file. Any updates will be
available immediately with `berrybrew available`.
Send in the all string as a subcommand and instead of listing the most
recent version for every major version, we'll download every version that
Strawberry has to offer.
#### install
Usage: `berrybrew install <version>`
View
@@ -80,7 +80,15 @@ class bbconsole {
break;
case "fetch":
BB.PerlUpdateAvailableList();
bool allPerls = false;
if (args.Length > 1){
if (args[1].StartsWith("h"))
BB.Message.Say("subcmd.fetch");
else
allPerls = args[1].Equals("all");
}
BB.PerlUpdateAvailableList(allPerls);
BB.PerlUpdateAvailableListOrphans();
break;
@@ -97,6 +105,10 @@ class bbconsole {
BB.Message.Say("subcmd.exec");
break;
case "fetch":
BB.Message.Say("subcmd.fetch");
break;
case "use":
BB.Message.Say("subcmd.use");
break;
View
@@ -962,7 +962,7 @@ public class Berrybrew {
this.bypassOrphanCheck = true;
}
public void PerlUpdateAvailableList(){
public void PerlUpdateAvailableList(bool allPerls=false){
Console.WriteLine("Attempting to fetch the updated Perls list...");
@@ -1019,7 +1019,7 @@ public class Berrybrew {
string majorVersion = majorVersionParts[0] + "." + majorVersionParts[1];
string bbMajorVersion = majorVersion + "_" + bits;
if (perls.Contains(bbMajorVersion))
if (perls.Contains(bbMajorVersion) && ! allPerls)
continue;
perls.Add(bbMajorVersion);

0 comments on commit b2417db

Please sign in to comment.