Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Atom Gitkraken Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Sheogorath
Atom Gitkraken Plugin
Commits
0f6da420
Commit
0f6da420
authored
Jul 16, 2016
by
Daniel Bayley
Browse files
Options
Downloads
Patches
Plain Diff
Tidy up
parent
fb5670e3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.editorconfig
+7
-3
7 additions, 3 deletions
.editorconfig
README.md
+4
-4
4 additions, 4 deletions
README.md
index.coffee
+19
-20
19 additions, 20 deletions
index.coffee
with
30 additions
and
27 deletions
.editorconfig
+
7
−
3
View file @
0f6da420
...
@@ -4,11 +4,15 @@ root = true
...
@@ -4,11 +4,15 @@ root = true
end_of_line
=
LF
end_of_line
=
LF
charset
=
utf-8
charset
=
utf-8
trim_trailing_whitespace
=
true
insert_final_newline
=
true
indent_style
=
tab
indent_style
=
tab
indent_size
=
2
indent_size
=
2
trim_trailing_whitespace
=
true
insert_final_newline
=
true
[*.md]
[*.md]
trim_trailing_whitespace
=
false
trim_trailing_whitespace
=
false
[{*.md,package.json}]
indent_style
=
space
indent_size
=
2
This diff is collapsed.
Click to expand it.
README.md
+
4
−
4
View file @
0f6da420
This diff is collapsed.
Click to expand it.
index.coffee
+
19
−
20
View file @
0f6da420
{
execSync
,
exec
}
=
require
'child_process'
{
execSync
,
exec
}
=
require
'child_process'
{
writeFile
,
unlink
}
=
require
'fs'
{
writeFile
,
unlink
}
=
require
'fs'
SubAtom
=
require
'sub-atom'
tmp
=
'/tmp/GitKraken.json'
id
=
'com.axosoft.GitKraken'
selector
=
'[class^="status-bar"] .git-branch'
#-------------------------------------------------------------------------------
module
.
exports
=
module
.
exports
=
#os: process.platform
#os: process.platform
#timeout:
#timeout:
#timeout: 10000
#timeout: 10000
#killSignal: 'SIGKILL'
#killSignal: 'SIGKILL'
subs
:
null
activate
:
->
project
:
atom
.
project
.
getDirectories
()[
0
]
SubAtom
=
require
'sub-atom'
tmp
:
'/tmp/GitKraken.json'
@
subs
=
new
SubAtom
id
:
'com.axosoft.GitKraken'
selector
:
'[class^=status-bar] .git-branch'
subs
:
new
SubAtom
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
activate
:
->
@
subs
.
add
atom
.
commands
.
add
'atom-workspace'
,
@
subs
.
add
atom
.
commands
.
add
'atom-workspace'
,
'gitkraken:release'
:
=>
@
open
()
'gitkraken:release'
:
=>
@
open
@
project
atom
.
packages
.
onDidActivateInitialPackages
=>
atom
.
packages
.
onDidActivateInitialPackages
=>
@
subs
.
add
'status-bar'
,
'click'
,
selector
,
@
open
@
subs
.
add
'status-bar'
,
'click'
,
selector
,
@
open
@
project
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
open
:
->
open
:
({
path
})
->
{
path
}
=
atom
.
project
.
getDirectories
()[
0
]
if
atom
.
config
.
get
'gitkraken.singleInstance'
if
atom
.
config
.
get
'gitkraken.singleInstance'
exec
"pkill GitKraken; sleep .1 && open -Fb
#{
id
}
--args -p '
#{
path
}
'"
#, @timeout
exec
"pkill GitKraken; sleep .1 && open -Fb
#{
@
id
}
--args -p '
#{
path
}
'"
#, @timeout
else
else
projects
=
{}
projects
=
{}
try
try
projects
=
require
tmp
projects
=
require
@
tmp
execSync
"ps
#{
projects
[
path
]
}
| grep -q GitKraken &&
execSync
"ps
#{
projects
[
path
]
}
| grep -q GitKraken &&
open -b
#{
id
}
--args -p '
#{
path
}
'"
open -b
#{
@
id
}
--args -p '
#{
path
}
'"
catch
catch
pid
=
execSync
"open -nb
#{
id
}
--args -p '
#{
path
}
' & echo $!"
pid
=
execSync
"open -nb
#{
@
id
}
--args -p '
#{
path
}
' & echo $!"
projects
[
path
]
=
(
parseInt
pid
)
+
1
projects
[
path
]
=
(
parseInt
pid
)
+
1
writeFile
tmp
,
JSON
.
stringify
projects
writeFile
@
tmp
,
JSON
.
stringify
projects
window
.
addEventListener
'beforeunload'
,
->
window
.
addEventListener
'beforeunload'
,
->
exec
"kill
#{
projects
[
path
]
}
"
exec
"kill
#{
projects
[
path
]
}
"
...
@@ -47,4 +46,4 @@ module.exports =
...
@@ -47,4 +46,4 @@ module.exports =
deactivate
:
->
deactivate
:
->
@
subs
.
dispose
()
@
subs
.
dispose
()
window
.
removeEventListener
'beforeunload'
window
.
removeEventListener
'beforeunload'
unlink
tmp
unlink
@
tmp
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment