Skip to content

Commit a288437

Browse files
authored
Adding mini CLI script for cloning repos (#40)
* Adding mini CLI tool for cloning repos - Not finding a similar tool and tired already of forgetting to do my `pre-commit install` step when cloning a repo, > - It's in a repo so it can be maintained, moved around, etc. - When I asked in Slack #general if such a tool existed, I found out it didn't and it was suggested (thanks @tumido f> - IIUC, my patch to the Dockerfile should pull in v0.1 of this bash script, drop it where it's in the user's $PATH, and makes sure the file is executable - Patches to this patch, and to the upstream script, are very welcome - Also, suggestions on what I can do better in v0.2 are welcome; my bash skills are basic and rusty, happy for any help and tips - My concept here is that we may want to have a handful of individual tools, and then be able call them by `o1 toolname OPTIONS ARGUMENT TARGET`-sort of thing, as a way to ease the life of contributors, and help keep our work net and tidy. :) Signed-of by: Karsten Wade <kwade@redhat.com> <quaid@iquaid.org> * Missed gluing the executable lines together - I'm new at this Dockerfile thing, and I realized when viewing the PR online what I had missed. - Live and learn :) Signed-off by: Karsten Wade <kwade@redhat.com> <quaid@iquaid.org> * Contributing o1-clone to project - I'm contributing this small script to the project, which was my intention from the start but I wasn't sure where to make the pull request against, or where to take the idea to discuss it! - As per the discussion in the PR[1] I am moving the script here. - I am unclear if this is the correct way to have that script deployed into the user's $PATH and made executable? - If the patch is accepted, I guess the answer is yes! Signed-off by: Karsten Wade <kwade@redhat.com> <quaid@iquaid.org> * Removing double-installation If the new script is in the `scripts` folder, it is already being copied into `/usr/local/bin`. * removing stray character * Removing whitespace ok, now it should clear pre-commit check
1 parent a41c824 commit a288437

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

scripts/o1-clone

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
# Script to clone from github.com/operate-first/ and setup the environment
3+
# (C) 2021 Karsten Wade <kwade@redhat.com> <quaid@iquaid.org
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
#
18+
# This barebones script is not very clever, because it is just trying to
19+
# clone a repo and set it up according to Operate First community practices:
20+
# https://URL_FOR_COMMUNITY_PRACTICES_NEEDED
21+
#
22+
# Use:
23+
# ./o1-tools/bin/o1-clone repo-name
24+
#
25+
# For example:
26+
# ./o1-tools/bin/o1-clone community-handbook
27+
#
28+
#
29+
# Let's presume you want something from the /operate-first/ org and take in
30+
# the first bash variable as the repo name:
31+
git clone git@github.com:operate-first/$1.git
32+
# Enter the project to prepare the environment
33+
cd $1
34+
# Install pre-commit hooks and whatever else it does
35+
pre-commit install
36+
#
37+
# That's it for now, what other environment activities could we do here?

0 commit comments

Comments
 (0)