Skip to content

Commit 7d2ffc6

Browse files
committed
update isomorphic-git version
1 parent 9f45fc6 commit 7d2ffc6

3 files changed

Lines changed: 34 additions & 42 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"feed": "^2.0.4",
3434
"fs-extra": "^7.0.1",
3535
"gray-matter": "^4.0.1",
36-
"isomorphic-git": "^0.78.3",
36+
"isomorphic-git": "1.0.0-beta.19",
3737
"junk": "^3.1.0",
3838
"less": "^3.9.0",
3939
"lowdb": "^1.0.0",

src/server/deploy.ts

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import fs from 'fs'
22
import moment from 'moment'
33
// @ts-ignore
4-
import * as git from 'isomorphic-git/dist/for-node/isomorphic-git/index'
4+
import * as git from 'isomorphic-git/dist'
55
import Model from './model'
66

7+
const { http } = require('isomorphic-git/dist/http')
8+
79
export default class Deploy extends Model {
810
outputDir: string = `${this.appDir}/output`
911

@@ -48,13 +50,13 @@ export default class Deploy extends Model {
4850
}
4951
if (!isRepo) {
5052
await git.init({ fs, dir: this.outputDir })
51-
await git.config({
53+
await git.setConfig({
5254
fs,
5355
dir: this.outputDir,
5456
path: 'user.name',
5557
value: setting.username,
5658
})
57-
await git.config({
59+
await git.setConfig({
5860
fs,
5961
dir: this.outputDir,
6062
path: 'user.email',
@@ -91,7 +93,7 @@ export default class Deploy extends Model {
9193
if (isRepo) {
9294
result = await this.commonPush()
9395
} else {
94-
result = await this.firstPush()
96+
// result = await this.firstPush()
9597
}
9698
return result
9799
}
@@ -103,19 +105,19 @@ export default class Deploy extends Model {
103105

104106
try {
105107
await git.init({ fs, dir: this.outputDir })
106-
await git.config({
108+
await git.setConfig({
107109
fs,
108110
dir: this.outputDir,
109111
path: 'user.name',
110112
value: setting.username,
111113
})
112-
await git.config({
114+
await git.setConfig({
113115
fs,
114116
dir: this.outputDir,
115117
path: 'user.email',
116118
value: setting.email,
117119
})
118-
await git.add({ fs, dir: this.outputDir, filepath: './*' })
120+
await git.add({ fs, dir: this.outputDir, filepath: '.' })
119121
await git.commit({
120122
fs,
121123
dir: this.outputDir,
@@ -126,16 +128,17 @@ export default class Deploy extends Model {
126128
})
127129
// await git.fastCheckout({ fs, dir: this.outputDir, ref: setting.branch })
128130
await this.checkCurrentBranch()
129-
const pushRes = await git.push({
130-
fs,
131-
dir: this.outputDir,
132-
remote: 'origin',
133-
ref: setting.branch,
134-
force: true,
135-
})
131+
// const pushRes = await git.push({
132+
// fs,
133+
// dir: this.outputDir,
134+
// remote: 'origin',
135+
// ref: setting.branch,
136+
// force: true,
137+
// http,
138+
// })
136139
return {
137140
success: true,
138-
data: pushRes,
141+
// data: pushRes,
139142
message: '',
140143
localBranchs,
141144
}
@@ -172,17 +175,18 @@ export default class Deploy extends Model {
172175

173176
await this.checkCurrentBranch()
174177

175-
const pushRes = await git.push({
176-
fs,
177-
dir: this.outputDir,
178-
remote: 'origin',
179-
ref: setting.branch,
180-
force: true,
181-
})
182-
console.log('pushRes', pushRes)
178+
// const pushRes = await git.push({
179+
// fs,
180+
// dir: this.outputDir,
181+
// remote: 'origin',
182+
// ref: setting.branch,
183+
// force: true,
184+
// http,
185+
// })
186+
// console.log('pushRes', pushRes)
183187
return {
184188
success: true,
185-
data: pushRes,
189+
// data: pushRes,
186190
message: '',
187191
localBranchs,
188192
}
@@ -211,7 +215,7 @@ export default class Deploy extends Model {
211215
await git.branch({ fs, dir: this.outputDir, ref: setting.branch })
212216
}
213217

214-
await git.fastCheckout({ fs, dir: this.outputDir, ref: setting.branch })
218+
await git.checkout({ fs, dir: this.outputDir, ref: setting.branch })
215219
}
216220
}
217221
}

yarn.lock

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5171,11 +5171,6 @@ globalthis@^1.0.0:
51715171
function-bind "^1.1.1"
51725172
object-keys "^1.0.12"
51735173

5174-
globalyzer@^0.1.4:
5175-
version "0.1.4"
5176-
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.4.tgz#bc8e273afe1ac7c24eea8def5b802340c5cc534f"
5177-
integrity sha512-LeguVWaxgHN0MNbWC6YljNMzHkrCny9fzjmEUdnF1kQ7wATFD1RHFRqA1qxaX2tgxGENlcxjOflopBwj3YZiXA==
5178-
51795174
globby@^6.1.0:
51805175
version "6.1.0"
51815176
resolved "http://registry.npm.taobao.org/globby/download/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
@@ -5211,11 +5206,6 @@ globby@^9.2.0:
52115206
pify "^4.0.1"
52125207
slash "^2.0.0"
52135208

5214-
globrex@^0.1.2:
5215-
version "0.1.2"
5216-
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
5217-
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==
5218-
52195209
good-listener@^1.2.2:
52205210
version "1.2.2"
52215211
resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"
@@ -6118,18 +6108,16 @@ isobject@^3.0.0, isobject@^3.0.1:
61186108
version "3.0.1"
61196109
resolved "http://registry.npm.taobao.org/isobject/download/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
61206110

6121-
isomorphic-git@^0.78.3:
6122-
version "0.78.3"
6123-
resolved "https://registry.yarnpkg.com/isomorphic-git/-/isomorphic-git-0.78.3.tgz#563d60f5f73868ba13701a33047fe356bacdca1f"
6124-
integrity sha512-3c8uqIg9tBBXFwypdlIo7yPM1x3uc7mNt4qbUvG2NPt8QYN1OFWo0MDNgHYfRIQWsgd8aux/qC3QnKyVqaq0TQ==
6111+
isomorphic-git@1.0.0-beta.19:
6112+
version "1.0.0-beta.19"
6113+
resolved "https://registry.yarnpkg.com/isomorphic-git/-/isomorphic-git-1.0.0-beta.19.tgz#421f0ae9de00c3ff967726f8eb5a0602929110ad"
6114+
integrity sha512-kJPF9R0HUdJmZcRWyYDH0ac2U3fCggScpU1Yn9kMZH8z+QEcNkCARPwH+bAKhaAYIQeb1ln3hufrGpAm/Ba8Gg==
61256115
dependencies:
61266116
async-lock "^1.1.0"
61276117
clean-git-ref "^2.0.1"
61286118
crc-32 "^1.2.0"
61296119
diff3 "0.0.3"
61306120
git-apply-delta "0.0.7"
6131-
globalyzer "^0.1.4"
6132-
globrex "^0.1.2"
61336121
ignore "^5.1.4"
61346122
marky "^1.2.1"
61356123
minimisted "^2.0.0"

0 commit comments

Comments
 (0)