Skip to content

Commit 59593b2

Browse files
committed
Remove dependency on 'find_git' and bump to v4.0.0.
1 parent b4d1387 commit 59593b2

File tree

5 files changed

+89
-140
lines changed

5 files changed

+89
-140
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,22 @@
1-
on: [push, pull_request]
1+
name: CI
22

3-
name: Continuous integration
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
48

5-
jobs:
6-
check:
7-
name: Check
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions-rs/toolchain@v1
12-
with:
13-
profile: minimal
14-
toolchain: stable
15-
override: true
16-
- uses: actions-rs/cargo@v1
17-
with:
18-
command: check
19-
20-
test:
21-
name: Test Suite
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions-rs/toolchain@v1
26-
with:
27-
profile: minimal
28-
toolchain: stable
29-
override: true
30-
- uses: actions-rs/cargo@v1
31-
with:
32-
command: test
9+
env:
10+
CARGO_TERM_COLOR: always
3311

34-
fmt:
35-
name: Rustfmt
36-
runs-on: ubuntu-latest
37-
steps:
38-
- uses: actions/checkout@v2
39-
- uses: actions-rs/toolchain@v1
40-
with:
41-
profile: minimal
42-
toolchain: stable
43-
override: true
44-
- run: rustup component add rustfmt
45-
- uses: actions-rs/cargo@v1
46-
with:
47-
command: fmt
48-
args: --all -- --check
49-
50-
clippy:
51-
name: Clippy
12+
jobs:
13+
tests:
5214
runs-on: ubuntu-latest
5315
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions-rs/toolchain@v1
56-
with:
57-
profile: minimal
58-
toolchain: stable
59-
override: true
60-
- run: rustup component add clippy
61-
- uses: actions-rs/cargo@v1
62-
with:
63-
command: clippy
64-
args: -- -D warnings
16+
- uses: actions/checkout@v4
17+
- name: Check formatting
18+
run: cargo fmt --check
19+
- name: Run clippy
20+
run: cargo clippy --all-targets -- --deny warnings
21+
- name: Run tests
22+
run: cargo test

Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ license = "Apache-2.0 OR MIT"
88
name = "add-remote"
99
readme = "README.md"
1010
repository = "https://github.com/Fraser999/Add-Remote.git"
11-
version = "3.0.3"
11+
version = "4.0.0"
1212

1313
[dependencies]
1414
base64 = "0.22.1"
1515
colour = "2.1.0"
16-
ctrlc = "3.4.4"
17-
find_git = "1.2.0"
18-
reqwest = { version = "0.12.4", features = ["blocking"] }
19-
serde_json = "1.0.117"
16+
ctrlc = "3.4.7"
17+
reqwest = { version = "0.12.19", features = ["blocking"] }
18+
serde_json = "1.0.140"
19+
20+
[badges.maintenance]
21+
status = "passively-maintained"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ Having run these Git config commands, your .gitconfig should contain the followi
9696

9797
## Note
9898

99-
`add-remote` only works with projects hosted on GitLab or GitHub.
99+
`add-remote` only works with projects hosted on GitLab or GitHub. It also requires
100+
`git` to be available in your `PATH` environment variable.
100101

101102
## License
102103

src/main.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn main() {
4747
let mut repo = Repo::default();
4848
if repo.has_no_available_forks() {
4949
yellow_ln!("There are no forks available which aren't already a remote:");
50-
println!("{}", repo.git_remote_verbose_output());
50+
println!("{}", repo::git_remote_verbose_output());
5151
return;
5252
}
5353
repo.show_available_forks();
@@ -61,7 +61,7 @@ fn main() {
6161
/// Prints the help message.
6262
fn print_help() {
6363
print!(
64-
r#"
64+
r"
6565
Add a remote fork to a local Git repository. When run from a Git repo, it queries GitLab or GitHub
6666
for the full list of forks and offers simple choices for adding one under a local alias. The added
6767
fork will be configured with a pull-url only; the push-url will be disabled.
@@ -76,24 +76,24 @@ be chosen as follows:
7676
7777
* if there's only one fork available, it will be selected, or else
7878
* the main fork/source owner if not already added locally, or else
79-
* the fork indicated by the Git config value of "#
79+
* the fork indicated by the Git config value of "
8080
);
8181
dark_cyan!("add-remote.preferredFork");
8282
print!(
83-
r#" if set, and if that fork
83+
r" if set, and if that fork
8484
is not already added locally
8585
86-
You can set "#
86+
You can set "
8787
);
8888
dark_cyan!("add-remote.preferredFork");
8989
println!(" (e.g. to 'CasperLabs') by running:\n");
9090
yellow_ln!(" git config --global --add add-remote.preferredFork CasperLabs");
9191
print!(
92-
r#"
92+
r"
9393
Having chosen the fork to add, you will then be asked to provide an alias for it. Again, a default
9494
value will be presented, chosen as follows:
9595
96-
* if this is the main fork/source owner, uses the Git config value of "#
96+
* if this is the main fork/source owner, uses the Git config value of "
9797
);
9898
dark_cyan_ln!("add-remote.mainForkOwnerAlias");
9999
print!(
@@ -102,18 +102,18 @@ value will be presented, chosen as follows:
102102
);
103103
dark_cyan!("add-remote.forkAlias");
104104
print!(
105-
r#" if set
105+
r" if set
106106
* uses the fork-owner's name
107107
108-
You can set "#
108+
You can set "
109109
);
110110
dark_cyan!("add-remote.mainForkOwnerAlias");
111111
println!(" (e.g. to 'owner') by running:\n");
112112
yellow_ln!(" git config --global --add add-remote.mainForkOwnerAlias owner");
113113
print!(
114-
r#"
114+
r"
115115
Default aliases can be added to your .gitconfig file under the subkey
116-
"#
116+
"
117117
);
118118
dark_cyan!("add-remote.forkAlias.<owner's name>");
119119
println!(" by running e.g:\n");
@@ -137,9 +137,9 @@ then add it **along with your GitHub username** separated with a colon ':' to yo
137137
);
138138
yellow_ln!(" git config --global --add add-remote.gitHubToken <GitHub Username:GitHub Token's Value>");
139139
println!(
140-
r#"
140+
r"
141141
Having run these Git config commands, your .gitconfig should contain the following:
142-
"#
142+
"
143143
);
144144
dark_green_ln!(
145145
r#"[add-remote]

0 commit comments

Comments
 (0)