Skip to content

Commit

Permalink
prep v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed Nov 11, 2022
1 parent 4d3a7b2 commit 83b1af2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@

```
$ bp --help
backpack 1.0.0
backpack 1.5.0
Create projects from existing repos
USAGE:
backpack <SUBCOMMAND>
bp <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
apply apply remote files into a folder [projects: a]
add Add a repo as a project
apply apply remote files into a folder [aliases: a]
cache cache handling
config create custom configuration
help Print this message or the help of the given subcommand(s)
new initialize a new project [projects: n]
new initialize a new project [aliases: n]
```

To generate a new project, you can use any repo:
Expand All @@ -70,6 +71,15 @@ Otherwise, grab a release from [releases](https://github.com/rusty-ferris-club/b

## :hammer: Create starters from ordinary repos

Go to your ordinary repo and follow the `add` wizard:

```
$ cd your-repo
$ bp add
```

## :hammer: Create starters manually

Create a `backpack.yaml`:

```
Expand Down
2 changes: 1 addition & 1 deletion backpack/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "backpack"
version = "1.4.0"
version = "1.5.0"
edition = "2021"


Expand Down
27 changes: 0 additions & 27 deletions backpack/src/bin/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,10 @@ pub fn command() -> Command<'static> {
}

pub fn run(_matches: &ArgMatches, subcommand_matches: &ArgMatches) -> AnyResult<bool> {
// get a repo
// arg given -> from arg
// arg not given -> git provider, cmd to extract current remote
// parse it to see that its valid
// initialize a Location, and then resolve it per usual.
// next,
// -> canonicalize to https and git, and ask which one
// if exists in config, say it and skip.
//
// show current projects,
// ask what to call it (populate with init-name)
// with selected, get the current config, load it, mutate, and store
// done

// XXX fix this to fallback onto git, and then bail if none there too
let repo = subcommand_matches
.get_one::<String>("repo")
.map_or_else(|| GitCmd::default().get_local_url(), |r| Ok(r.to_string()))?;

// build Location
// git preference
// if user flag -> true
// otherwise web

// load configuration
// show all projects
// ask how to call the new one
// store to config
// ask if to open
// open with an open crate

let (config, _) = Config::load_or_default().context("could not load configuration")?;

let prompt = &mut Prompt::build(&config, false, None);
Expand Down

0 comments on commit 83b1af2

Please sign in to comment.