mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
checkout the correct version
This commit is contained in:
parent
240280a0ae
commit
62eddf8982
1 changed files with 9 additions and 2 deletions
|
@ -132,7 +132,9 @@ module.exports = (grunt) ->
|
||||||
["check:make"].concat(
|
["check:make"].concat(
|
||||||
("install:#{service.name}" for service in SERVICES)
|
("install:#{service.name}" for service in SERVICES)
|
||||||
).concat([ "install:dirs"])
|
).concat([ "install:dirs"])
|
||||||
|
|
||||||
grunt.registerTask 'install', 'install:all'
|
grunt.registerTask 'install', 'install:all'
|
||||||
|
|
||||||
grunt.registerTask 'update:all', "Checkout and update all ShareLaTeX services",
|
grunt.registerTask 'update:all', "Checkout and update all ShareLaTeX services",
|
||||||
["check:make"].concat(
|
["check:make"].concat(
|
||||||
("update:#{service.name}" for service in SERVICES)
|
("update:#{service.name}" for service in SERVICES)
|
||||||
|
@ -194,16 +196,21 @@ module.exports = (grunt) ->
|
||||||
if !fs.existsSync(dir)
|
if !fs.existsSync(dir)
|
||||||
proc = spawn "git", [
|
proc = spawn "git", [
|
||||||
"clone",
|
"clone",
|
||||||
"-b", service.version,
|
|
||||||
repo_src,
|
repo_src,
|
||||||
dir
|
dir
|
||||||
], stdio: "inherit"
|
], stdio: "inherit"
|
||||||
proc.on "close", () ->
|
proc.on "close", () ->
|
||||||
callback()
|
Helpers.checkoutVersion service, callback
|
||||||
else
|
else
|
||||||
console.log "#{dir} already installed, skipping."
|
console.log "#{dir} already installed, skipping."
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
|
checkoutVersion: (service, callback = (error) ->) ->
|
||||||
|
dir = service.name
|
||||||
|
proc = spawn "git", ["checkout", service.version], stdio: "inherit", cwd: dir
|
||||||
|
proc.on "close", () ->
|
||||||
|
callback()
|
||||||
|
|
||||||
updateGitRepo: (service, callback = (error) ->) ->
|
updateGitRepo: (service, callback = (error) ->) ->
|
||||||
dir = service.name
|
dir = service.name
|
||||||
proc = spawn "git", ["checkout", service.version], cwd: dir, stdio: "inherit"
|
proc = spawn "git", ["checkout", service.version], cwd: dir, stdio: "inherit"
|
||||||
|
|
Loading…
Reference in a new issue