Electron_03 - Electron-builder

安装 Electron-builder

$ git clone https://github.com/electron/electron-quick-start

$ cd electron-quick-start

$ yarn add electron-builder --dev // 官方推荐

or

$ npm install elctron-builder --save-dev
阅读全文

Electron_02 - Electron-packager

安装 Electron-packager

需要 Node.js 6.0 或更高版本

npm install electron-packager --save-dev

electron-packager API

使用命令行打包

electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]

必需参数

  • sourcedir - 应用程序源

阅读全文

Git 关联到GigHub

创建 SSH Keygen

使用ssh-keygen生成私钥和公钥

$ ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/yog/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/yog/.ssh/id_rsa.
Your public key has been saved in /c/Users/yog/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:0ZYdnPILyMbV9xpgRE/hWf1MayqhoEYquZTuOMr8EcE yog@YOG-DESKTOP
The key's randomart image is:
+---[RSA 3072]----+
|           =+.o.o|
|  .      .oo*=.oo|
|   E   o.o++.o++o|
|    .. .=o... .o+|
|  o.o ..S ....oo |
| = ..o   . ....  |
|o o..       .    |
|=o  .            |
|==..             |
+----[SHA256]-----+
阅读全文

Git 查看提交日志

git log

基础查看提交日志

$ git log

commit 2c8fcc81f23aa96073250e1d052473337c968d88 (HEAD -> master, origin/master)
Author: yogwang <yogwang@yog.red>
Date:   Mon Jun 17 12:10:01 2019 +0800

    wrote a readme file

commit 87c9d12bdd979859811fc224c7f9ade7b97b0d13
Author: yogwang <yogwang@yog.red>
Date:   Mon Jun 17 09:52:50 2019 +0800

    add distributed

commit 77ac9552a7fb2e8d1f57d324d991de11efa897f2
Author: yogwang <yogwang@yog.red>
Date:   Mon Jun 17 09:50:33 2019 +0800

    wrote a readme file
阅读全文

Git 操作命令

添加文件到仓库 git add

$ git add *

提交文件到仓库 git commit

$ git commit -m "Here is the message"

commit 命令可以提交多个之前 add 的文件

$ git add file1.txt
$ git add file2.txt file3.txt
$ git commit -m "add 3 files."
阅读全文

Git 创建版本库

创建一个空目录

$ mkdir git_demo
$ cd git_demo

创建 Git 仓库

进入目录后通过git init命令创建 Git 仓库

$ git init

Initialized empty Git repository in E:/GitLibrary/git_demo/.git/
阅读全文

安装 Git in windows


Git 官网:https://git-scm.com/

设置提交时的 NAME 和 EMAIL:

$ git config --global user.name "nikename"

$ git config --global user.email "example@example.com"

查看设置的 NAME 和 EMAIL:

$ git config user.name

$ git config user.email

Electron_01 - 快速启动

自己创建 Electron 应用

1. 使用 npm 初始化一个项目

$ mkdir my-app

$ cd my-app

$ npm init --y
Wrote to E:\my-app\package.json:
{
  "name": "my-app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

修改入口文件为 main.js 并且添加 start 脚本引导 Node 来执行 Electron

阅读全文