Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ OPTIONS="-o Debug::NoLocking=1
-o APT::Install-Suggests=0
"

cp ../powershell_*ubuntu.14.04_amd64.deb .
cp ../powershell*ubuntu.14.04_amd64.deb .

# Add local repository so that we can install deb files
# that were downloaded outside of a repository
Expand Down
22 changes: 14 additions & 8 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -600,17 +600,23 @@ function New-UnixPackage {
}
}

# Determine if the version is a preview version
$IsPreview = $Version.Contains("-preview")

# Preview versions have preview in the name
$Name = if ($IsPreview) { "powershell-preview" } else { "powershell" }

# Verify dependencies are installed and in the path
Test-Dependencies

$Description = $packagingStrings.Description

# Suffix is used for side-by-side package installation
$Suffix = $Name -replace "^powershell"
if (!$Suffix) {
Write-Verbose "Suffix not given, building primary PowerShell package!"
$Suffix = $packageVersion
}
# Break the version down into its components, we are interested in the major version
$VersionMatch = [regex]::Match($Version, '(\d+)(?:.(\d+)(?:.(\d+)(?:-preview(?:.(\d+))?)?)?)?')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use PowerShell syntax

$MajorVersion = $VersionMatch.Groups[1].Value

# Suffix is used for side-by-side preview/release package installation
$Suffix = if ($IsPreview) { $MajorVersion + "-preview" } else { $MajorVersion }

# Setup staging directory so we don't change the original source directory
$Staging = "$PSScriptRoot/staging"
Expand All @@ -627,9 +633,9 @@ function New-UnixPackage {

# Destination for symlink to powershell executable
$Link = if ($Environment.IsLinux) {
"/usr/bin/"
if ($IsPreview) { "/usr/bin/pwsh-preview" } else { "/usr/bin/pwsh" }
} elseif ($Environment.IsMacOS) {
"/usr/local/bin/"
if ($IsPreview) { "/usr/local/bin/pwsh-preview" } else { "/usr/local/bin/pwsh" }
}
$linkSource = "/tmp/pwsh"

Expand Down
2 changes: 0 additions & 2 deletions tools/travis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ elseif($Stage -eq 'Build')

# Only build packages for branches, not pull requests
$packages = @(Start-PSPackage @packageParams -SkipReleaseChecks)
# Packaging AppImage depends on the deb package
$packages += Start-PSPackage @packageParams -Type AppImage -SkipReleaseChecks
foreach($package in $packages)
{
# Publish the packages to the nuget feed if:
Expand Down