github-create 0.5 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -3
- data/bin/ghcreate +3 -3
- data/lib/github-create/version.rb +1 -1
- data/lib/github-create.rb +12 -10
- metadata +2 -2
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
github-create
|
2
2
|
==============
|
3
3
|
|
4
|
-
Adds an executable `ghcreate` which will help you by creating github repos from your command line
|
4
|
+
Adds an executable `ghcreate` which will help you by creating github repos from your command line.
|
5
|
+
|
6
|
+
*Won't work with windows*
|
5
7
|
|
6
8
|
Install
|
7
9
|
--------
|
@@ -17,12 +19,14 @@ Usage
|
|
17
19
|
Options
|
18
20
|
--------
|
19
21
|
|
20
|
-
`-c NAME, --create NAME`
|
22
|
+
`-c NAME, --create NAME` specify the name of the repo to create
|
21
23
|
|
22
|
-
`-p, --private`
|
24
|
+
`-p, --private` creates private repo when this option is used
|
23
25
|
|
24
26
|
`--clear` clear github username, stored in $HOME/.github-create
|
25
27
|
|
26
28
|
`-r NAME, --remote NAME` set the origin name. If not specified origin or github is used
|
27
29
|
|
28
30
|
`-h, --help` displays help message
|
31
|
+
|
32
|
+
|
data/bin/ghcreate
CHANGED
@@ -18,7 +18,7 @@ OptionParser.new do |option|
|
|
18
18
|
exit
|
19
19
|
end
|
20
20
|
|
21
|
-
option.on("-c NAME", "--create NAME", "
|
21
|
+
option.on("-c NAME", "--create NAME", "specifies the name of the repo to create") do |n|
|
22
22
|
repoName = n
|
23
23
|
end
|
24
24
|
|
@@ -30,7 +30,7 @@ end.parse!
|
|
30
30
|
|
31
31
|
# parse the t hash to check if there are any repos to be created
|
32
32
|
unless repoName.nil?
|
33
|
-
puts "
|
34
|
-
puts "
|
33
|
+
puts "Repo name: " << repoName
|
34
|
+
puts "Remote name: " << remoteName
|
35
35
|
GithubCreate.setupRepo repoName, remoteName, access
|
36
36
|
end
|
data/lib/github-create.rb
CHANGED
@@ -57,13 +57,12 @@ class GithubCreate
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.createLocalRepo
|
60
|
-
system(
|
60
|
+
system("git init")
|
61
61
|
puts "Create local repo: git init"
|
62
62
|
end
|
63
63
|
|
64
64
|
def self.checkIfLocalRepoExists
|
65
|
-
|
66
|
-
return true
|
65
|
+
system("git status -s > /dev/null 2>&1")
|
67
66
|
end
|
68
67
|
|
69
68
|
def self.setupRemote(remoteName, remoteUrl)
|
@@ -87,17 +86,15 @@ class GithubCreate
|
|
87
86
|
end
|
88
87
|
|
89
88
|
def self.checkIfRemoteExists(remote)
|
90
|
-
return
|
91
|
-
return false
|
89
|
+
return system("git remote show "<< remote << "> /dev/null 2>&1")
|
92
90
|
end
|
93
91
|
|
94
92
|
def self.addRemote(remoteName, remoteUrl)
|
95
|
-
|
96
|
-
return false
|
93
|
+
system("git remote add " << remoteName << " " << remoteUrl)
|
97
94
|
end
|
98
95
|
|
99
96
|
def self.getRemoteUrl(repo)
|
100
|
-
# TODO
|
97
|
+
# TODO. not required right now
|
101
98
|
end
|
102
99
|
|
103
100
|
# this returns the password for use in the other methods
|
@@ -106,8 +103,13 @@ class GithubCreate
|
|
106
103
|
if username.nil?
|
107
104
|
username = createConfigFile
|
108
105
|
end
|
109
|
-
print "
|
110
|
-
|
106
|
+
print "Github password for " << username << ": "
|
107
|
+
|
108
|
+
system "stty -echo"
|
109
|
+
pw = gets.chomp
|
110
|
+
system "stty echo"
|
111
|
+
puts
|
112
|
+
return pw
|
111
113
|
end
|
112
114
|
|
113
115
|
# only stores the github username
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: github-create
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: "0.
|
5
|
+
version: "0.7"
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Akash Manohar
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-03-01 00:00:00 +05:30
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|