You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cpgc/index.js

40 lines
1.2 KiB
JavaScript

const { platform, EOL } = require('os');
const { execSync } = require('child_process');
5 years ago
const fs = require('fs');
const path = require('path');
const { app, BrowserWindow } = require('electron');
const ipc = require('electron').ipcMain;
5 years ago
function createWindow() {
5 years ago
let win = new BrowserWindow({
5 years ago
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
5 years ago
//win.loadFile('html/index.html');
5 years ago
// win.webContents.openDevTools()
win.webContents.on('did-finish-load', () => {
win.webContents.send('send_username', name);
win.webContents.send('send_useremail', email);
win.webContents.send('send_remote', remote);
win.webContents.send('send_status', status);
win.webContents.send('send_log', log);
win.webContents.send('send_branch', branch);
});
5 years ago
}
5 years ago
//app.on('ready', createWindow);
5 years ago
5 years ago
// let user = execSync("git config --list").toString().split(EOL);
let email = execSync("git config user.email").toString();
let name = execSync("git config user.name").toString();
let remote = execSync("git config remote.origin.url").toString();
5 years ago
let status = execSync("git status").toString();
let log = execSync("git log").toString();
5 years ago
let branch = execSync("git branch").toString().split("\n");
console.log(branch[0].split(' ')[1]);