<commit_before>
# the version under development, update after a release
$version = '4.1.0.0'

function isVersionTag($tag){
    $v = New-Object Version
    [Version]::TryParse(($tag).Replace('-alpha','').Replace('-beta',''), [ref]$v)
}

# append the AppVeyor build number as the pre-release version
if ($env:appveyor){
    $version = $version + '-b' + [int]::Parse($env:appveyor_build_number).ToString('000')
    if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){
        $version = $env:appveyor_repo_tag_name
    }
    Update-AppveyorBuild -Version $version
} else {
    $version = $version + '-b001'
}

$nuget = (gi .\.nuget\NuGet.exe).FullName

function pack($nuspec){
    $dir = [IO.Path]::GetDirectoryName($nuspec)
    rm "$dir\*.nupkg"
    try {
        pushd $dir
        & $nuget pack $nuspec -Version $version -NoDefaultExcludes -Verbosity d
        if (-not ($?)) { exit 1; }
    } finally {
        popd
    }    
}

pack(gi .\FSharp.Core.Nuget\FSharp.Core.nuspec)
pack(gi .\FSharp.Compiler.Tools.Nuget\FSharp.Compiler.Tools.nuspec)

if(!(Test-Path -Path "lib\release\" )) {
    mkdir lib\release\
}
copy FSharp.Core.Nuget\*.nupkg lib\release
copy FSharp.Compiler.Tools.Nuget\*.nupkg lib\release
<commit_msg>use -BasePath for nuget, no need to cd<commit_after>
# the version under development, update after a release
$version = '4.1.0.0'

function isVersionTag($tag){
    $v = New-Object Version
    [Version]::TryParse(($tag).Replace('-alpha','').Replace('-beta',''), [ref]$v)
}

# append the AppVeyor build number as the pre-release version
if ($env:appveyor){
    $version = $version + '-b' + [int]::Parse($env:appveyor_build_number).ToString('000')
    if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){
        $version = $env:appveyor_repo_tag_name
    }
    Update-AppveyorBuild -Version $version
} else {
    $version = $version + '-b001'
}

$nuget = (gi .\.nuget\NuGet.exe).FullName

function pack($nuspec){
    $dir = [IO.Path]::GetDirectoryName($nuspec)
    & $nuget pack $nuspec -BasePath "$dir" -Version $version -NoDefaultExcludes -Verbosity d
}

pack(gi .\FSharp.Core.Nuget\FSharp.Core.nuspec)
pack(gi .\FSharp.Compiler.Tools.Nuget\FSharp.Compiler.Tools.nuspec)

if(!(Test-Path -Path "lib\release\" )) {
    mkdir lib\release\
}
copy FSharp.Core.Nuget\*.nupkg lib\release
copy FSharp.Compiler.Tools.Nuget\*.nupkg lib\release

{'fraction_non_alphanumeric': 0.16934487021013597, 'fraction_numerical': 0.00865265760197775, 'mean_word_length': 3.7889546351084813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2165551', 'n_tokens_mistral': 936, 'n_tokens_neox': 896, 'n_words': 176}