diff --git a/ruby/Gemfile b/ruby/Gemfile index 22274d1..5c16bbd 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -9,4 +9,4 @@ gem 'yard' gem 'puppet' gem 'puppet-strings' gem 'certified' -gem 'librarian-puppet' +gem 'anthill-librarian-puppet' diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 1fa5425..1e2d3d2 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,10 +1,11 @@ GEM remote: https://rubygems.org/ specs: + anthill-librarian-puppet (3.0.0) + librarianp (>= 0.6.3) + puppet_forge (~> 2.1) + rsync certified (1.0.0) - facter (2.5.1) - facter (2.5.1-x64-mingw32) - ffi (~> 1.9.5) facter (2.5.1-x86-mingw32) ffi (~> 1.9.5) faraday (0.13.1) @@ -12,7 +13,6 @@ GEM faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) fast_gettext (1.1.2) - ffi (1.9.25-x64-mingw32) ffi (1.9.25-x86-mingw32) gettext (3.2.9) locale (>= 2.0.5) @@ -24,40 +24,12 @@ GEM hiera (3.5.0) hocon (1.2.5) httpclient (2.8.3) - librarian-puppet (3.0.0) - librarianp (>= 0.6.3) - puppet_forge (~> 2.1) - rsync librarianp (0.6.4) thor (~> 0.15) locale (2.1.2) minitar (0.6.1) multi_json (1.13.1) multipart-post (2.0.0) - puppet (6.1.0) - facter (> 2.0.1, < 4) - fast_gettext (~> 1.1.2) - hiera (>= 3.2.1, < 4) - httpclient (~> 2.8) - locale (~> 2.1) - multi_json (~> 1.10) - puppet-resource_api (~> 1.5) - semantic_puppet (~> 1.0) - puppet (6.1.0-x64-mingw32) - facter (> 2.0.1, < 4) - fast_gettext (~> 1.1.2) - ffi (~> 1.9.25) - hiera (>= 3.2.1, < 4) - httpclient (~> 2.8) - locale (~> 2.1) - minitar (~> 0.6.1) - multi_json (~> 1.10) - puppet-resource_api (~> 1.5) - semantic_puppet (~> 1.0) - win32-dir (= 0.4.9) - win32-process (= 0.7.5) - win32-security (= 0.2.5) - win32-service (= 0.8.8) puppet (6.1.0-x86-mingw32) facter (> 2.0.1, < 4) fast_gettext (~> 1.1.2) @@ -101,13 +73,11 @@ GEM yard (0.9.16) PLATFORMS - ruby - x64-mingw32 x86-mingw32 DEPENDENCIES + anthill-librarian-puppet certified - librarian-puppet puppet puppet-strings rdoc diff --git a/src/async.ts b/src/async.ts index d02d385..6934f44 100644 --- a/src/async.ts +++ b/src/async.ts @@ -308,13 +308,11 @@ export function execFileReadIn(command: string, cwd: string, env?: any, cb?: Exe { var str = data.toString(), lines = str.split(/\r?\n/g); - for (let i = lines.length - 1; i >= 0; i--) + for (const line of lines) { - const line = lines[i]; if (line != "") { cb(line); - break; } } diff --git a/src/puppet.ts b/src/puppet.ts index 9ba7cb4..8679d7e 100644 --- a/src/puppet.ts +++ b/src/puppet.ts @@ -40,22 +40,20 @@ export module puppet return null; } - public static async CallBin(command: string, args: string[], cwd: string, cb?: async.ExecFileLineCallback): Promise + public static async CallBin(script: string, args: string[], cwd: string, env: any, cb?: async.ExecFileLineCallback): Promise { const argsTotal = [ Ruby.Path().rubyPath, - path.join(Ruby.Path().path, command) + path.join(Ruby.Path().path, script) ]; for (let arg of args) { argsTotal.push(arg); } - - const env: any = { - "SSL_CERT_FILE": require('app-root-path').resolve("ruby", "cacert.pem"), - "PATH": process.env["PATH"] + path.delimiter + Ruby.Path().path - }; + + env["SSL_CERT_FILE"] = require('app-root-path').resolve("ruby", "cacert.pem"); + env["PATH"] = process.env["PATH"] + path.delimiter + Ruby.Path().path; try { @@ -64,7 +62,7 @@ export module puppet } catch (e) { - console.log("Failed to execute command " + command + ": " + e); + console.log("Failed to execute command " + script + ": " + e); return false; } } @@ -849,14 +847,31 @@ export module puppet try { - await Ruby.CallBin("librarian-puppet", ["install", "--verbose"], this._path, (line: string) => + const lines: string[] = []; + + const env: any = {}; + + if (process.platform == "win32") + { + env["LIBRARIAN_PUPPET_USE_SHORT_CACHE_PATH"] = "true"; + env["LIBRARIAN_PUPPET_TMP"] = "C:/"; + } + + await Ruby.CallBin("librarian-puppet", ["install", "--verbose"], this._path, env, (line: string) => { if (line.length > 80) { line = line.substr(0, 80) + " ..."; } + + lines.push(line); + + if (lines.length > 4) + { + lines.splice(0, 1); + } - if (updateProgressCategory) updateProgressCategory(line, false); + if (updateProgressCategory) updateProgressCategory(lines.join("\n"), false); }); } catch (e) @@ -1315,14 +1330,31 @@ export module puppet try { - await Ruby.CallBin("librarian-puppet", ["install", "--verbose"], this._path, (line: string) => + const lines: string[] = []; + + const env: any = {}; + + if (process.platform == "win32") + { + env["LIBRARIAN_PUPPET_USE_SHORT_CACHE_PATH"] = "true"; + env["LIBRARIAN_PUPPET_TMP"] = "C:/"; + } + + await Ruby.CallBin("librarian-puppet", ["install", "--verbose"], this._path, env, (line: string) => { if (line.length > 80) { line = line.substr(0, 80) + " ..."; } + + lines.push(line); + + if (lines.length > 4) + { + lines.splice(0, 1); + } - if (updateProgressCategory) updateProgressCategory(line, false); + if (updateProgressCategory) updateProgressCategory(lines.join("\n"), false); }); } catch (e) diff --git a/src/windows/workspace/renderer.ts b/src/windows/workspace/renderer.ts index 9925ad4..2544bf5 100644 --- a/src/windows/workspace/renderer.ts +++ b/src/windows/workspace/renderer.ts @@ -920,7 +920,7 @@ export class WorkspaceRenderer { $('#workspace-contents').html('

' + '

' + - '

' + + '

' + 'Please wait while the workspace is updating cache

' + '

' + '