Skip to content

Commit 4178750

Browse files
author
James Brundage
committed
fix: Container.start.ps1 ( Fixes #13, Fixes #23, Fixes #24 )
Now launching current site if found.
1 parent fc35ac7 commit 4178750

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

Container.start.ps1

+4-18
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,6 @@ if ($args) {
7979
Split-Path |
8080
Push-Location
8181
}
82-
if (-not (Test-Path './Gemfile')) {
83-
$defaultGemFile = @(
84-
"source 'https://rubygems.org'"
85-
"gem 'jekyll', '~> $((jekyll --version) -replace '^jekyll\s' -replace '\s')'"
86-
if ($env:JekyllThemeName -and $env:JekyllThemeVersion) {
87-
"gem '$env:JekyllThemeName', '~> $env:JekyllThemeVersion'"
88-
} else {
89-
'gem "minima", "~> 2.5"'
90-
}
91-
"group :jejkyll_plugins do"
92-
" gem 'jekyll-feed', '~> 0.12'"
93-
"end"
94-
'gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]'
95-
) -join [Environment]::newline
96-
Set-Content -Path './Gemfile' -Value $defaultGemFile
97-
}
98-
9982
$jekyllJob = Start-PSJekyll
10083
while ($jekyllJob.State -notin 'Completed','Failed') {
10184
Start-Sleep -Milliseconds (Get-Random -Min 1000 -Max 10000)
@@ -115,7 +98,10 @@ if ($args) {
11598
{
11699
# If a single drive is mounted, start the Jekyll server.
117100
if ($mountedFolders.Length -eq 1) {
118-
Push-Location $mountedFolders[0].Fullname
101+
Push-Location $mountedFolders[0].Fullname
102+
Start-PSJekyll
103+
} elseif ($psJekyll.CurrentSite) {
104+
Push-Location $psJekyll.CurrentSite.Directory.FullName
119105
Start-PSJekyll
120106
}
121107
}

0 commit comments

Comments
 (0)