git_fonky 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -2
- data/lib/git_fonky/repo_dir.rb +3 -3
- data/lib/git_fonky/version.rb +1 -1
- data/lib/git_fonky.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eccc8024d2a7647279b20745e3391b414b457c855d7c15aac9b266e477728129
|
|
4
|
+
data.tar.gz: c3070a7b5cf6cf91383f128d0005d672b3abd3c4e485a6b2b3d610d9435d1df6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b6970b50cf13f82a013a68ea477e44d0f482f8fa051297f6d6ea36b5eea5d78dad480d4ce924c1b006de643b7f7e10ecb30425e8e828a271c69690260496365
|
|
7
|
+
data.tar.gz: 31a75d1eff266a71b12923338d34316f15876526e70055f8ca997426c9fa79badb11c758ef15157bb6244223009f15da0020c7eca6ad5615ec636bc8476bc2f6
|
data/README.md
CHANGED
|
@@ -16,10 +16,10 @@ GitFonky uses two environment variables in order to do its thing - `GFONK_DIR` a
|
|
|
16
16
|
Set this environment variable if you wish to override the default directory that GitFonky uses to look for your repositories within. If you do not set this
|
|
17
17
|
environment variable then the defualt is to use the current users HOME directory and then a directory called `/code`. This is would be something like `/Users/somebody/code` done via `"#{Dir.home}/code`.
|
|
18
18
|
|
|
19
|
-
If you set the `GFONK_DIR` environment variable you should set it to the path to the directory that contains all of the repositories you want to
|
|
19
|
+
If you set the `GFONK_DIR` environment variable you should set it to the full path to the directory that contains all of the repositories you want to
|
|
20
20
|
stop faking the funk with.
|
|
21
21
|
|
|
22
|
-
### GFONK_REPOS
|
|
22
|
+
### `GFONK_REPOS`
|
|
23
23
|
|
|
24
24
|
This environment variable must be set if you want any funk to happen! The value of this environment variable should be a string of repository names separated
|
|
25
25
|
only by commas (NO SPACES!):
|
|
@@ -36,6 +36,14 @@ export GFONK_REPOS="repo1,repo2:main,repo3:staging"
|
|
|
36
36
|
If you do not specify a branch for a repository then whatever the current branch is that you are on in a given
|
|
37
37
|
repository directory is the branch that will be used to attempt to sync the repository between the remotes.
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
### Running the fonk
|
|
41
|
+
The gem comes with a `bin` script that is used to kick off the process. To run the script, type the following in
|
|
42
|
+
your terminal:
|
|
43
|
+
```bash
|
|
44
|
+
gfonk
|
|
45
|
+
```
|
|
46
|
+
|
|
39
47
|
## Development
|
|
40
48
|
|
|
41
49
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/git_fonky/repo_dir.rb
CHANGED
|
@@ -3,7 +3,7 @@ require_relative "reporter"
|
|
|
3
3
|
|
|
4
4
|
module GitFonky
|
|
5
5
|
class RepoDir
|
|
6
|
-
def initialize(repo_name
|
|
6
|
+
def initialize(repo_name = nil, branch = nil, command: Command, reporter: Reporter)
|
|
7
7
|
@repo_name = repo_name
|
|
8
8
|
@command = command.new
|
|
9
9
|
@branch = branch || get_current_branch
|
|
@@ -11,9 +11,9 @@ module GitFonky
|
|
|
11
11
|
@reporter = reporter.new(@repo_name, @branch)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def self.sync(repo_name
|
|
14
|
+
def self.sync(repo_name, branch_name)
|
|
15
15
|
Dir.chdir(repo_name.to_s) do
|
|
16
|
-
new(repo_name
|
|
16
|
+
new(repo_name, branch_name).sync
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
data/lib/git_fonky/version.rb
CHANGED
data/lib/git_fonky.rb
CHANGED
|
@@ -12,8 +12,8 @@ module GitFonky
|
|
|
12
12
|
|
|
13
13
|
def self.sync_repos
|
|
14
14
|
Dir.chdir(GFONK_DIR) do
|
|
15
|
-
Repositories.parse_env.each do |
|
|
16
|
-
RepoDir.sync(repo_name
|
|
15
|
+
Repositories.parse_env.each do |repo_name, branch_name|
|
|
16
|
+
RepoDir.sync(repo_name, branch_name)
|
|
17
17
|
puts "\n" * 3
|
|
18
18
|
end
|
|
19
19
|
end
|