Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrige abrir no VSCode para mac + terminal #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const schema = {

let mainTray = {}

if (app.dock) {
app.dock.hide()
if (app.dock) {
app.dock.hide()
}

const store = new Store({ schema });
Expand All @@ -32,15 +32,29 @@ function render(tray = mainTray) {
{
label: 'Abrir no VSCode',
click: () => {
spawn('code', [path],{
cwd: process.cwd(),
env: {
PATH: process.env.PATH,
},
stdio: ['inherit'],
})
if(process.platform == 'darwin') {
spawn('open', ['-a', 'Visual Studio Code', [path]], { stdio: 'inherit' });
} else {
// Considerando que esse comando esta rodando no windows / linux
spawn('code', [path],{
cwd: process.cwd(),
env: {
PATH: process.env.PATH,
},
stdio: ['inherit'],
})
}
},
},
{
// Mac only por enquanto
label: 'Abrir no terminal',
click: function() {
if(process.platform == 'darwin') {
spawn('open', ['-a', 'Terminal', [path]], { stdio: 'inherit' });
}
}
},
{
label: 'Remover',
click: () => {
Expand Down