Skip to content

Commit

Permalink
Merge pull request #80 from WeihanLi/dev
Browse files Browse the repository at this point in the history
0.8.2
  • Loading branch information
WeihanLi authored Mar 25, 2024
2 parents 52d3209 + 16e0e1b commit ccb605d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ FROM base AS final
COPY --from=build-env /app/artifacts/http /root/.dotnet/tools/http
RUN ln -s /root/.dotnet/tools/http /root/.dotnet/tools/dotnet-http
ENV PATH="/root/.dotnet/tools:${PATH}"
ENTRYPOINT ["http"]
CMD ["--help"]
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dotnet tool update -g dotnet-execute --prerelease
dotnet tool update -g dotnet-execute

Write-Host 'dotnet-exec ./build/build.cs "--args=$ARGS"' -ForegroundColor GREEN

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

dotnet tool update -g dotnet-execute --prerelease
dotnet tool update -g dotnet-execute
export PATH="$PATH:$HOME/.dotnet/tools"

echo "dotnet-exec ./build/build.cs --args $@"
Expand Down
7 changes: 4 additions & 3 deletions build/build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var stable = ArgumentBool("stable", false);
var noPush = ArgumentBool("noPush", false);
var branchName = Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCHNAME") ?? "local";
stable |= branchName is "master" or "main";

var solutionPath = "./dotnet-httpie.sln";
string[] srcProjects = ["./src/HTTPie/HTTPie.csproj"];
Expand Down Expand Up @@ -59,7 +60,7 @@ await BuildProcess.CreateBuilder()
.WithDependency("test")
.WithExecution(async () =>
{
if (branchName == "master" || branchName == "main" || stable)
if (stable)
{
foreach (var project in srcProjects)
{
Expand All @@ -83,7 +84,7 @@ await BuildProcess.CreateBuilder()

if (string.IsNullOrEmpty(apiKey))
{
// try to get apiKey from environment variable
// try to get apiKey from the environment variable
apiKey = Environment.GetEnvironmentVariable("NuGet__ApiKey");

if (string.IsNullOrEmpty(apiKey))
Expand All @@ -93,7 +94,7 @@ await BuildProcess.CreateBuilder()
}
}

if (branchName != "master" && branchName != "main" && branchName != "preview")
if (!stable && branchName != "preview")
{
Console.WriteLine($"Skip push since branch name {branchName} not support push packages");
return;
Expand Down
2 changes: 1 addition & 1 deletion build/version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<VersionMajor>0</VersionMajor>
<VersionMinor>8</VersionMinor>
<VersionPatch>1</VersionPatch>
<VersionPatch>2</VersionPatch>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
<InformationalVersion>$(PackageVersion)</InformationalVersion>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/HTTPie/Implement/HttpParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public async IAsyncEnumerable<HttpRequestMessageWrapper> ParseFileAsync(string f
}

var (variableName, variableValue) = (splits[0], splits[1]);
if (variableValue.Length >= 1 && ((variableValue[0] == '"' && variableValue[^1] == '"') || (variableValue[0] == '\'' && variableValue[^1] == '\'')))
{
variableValue = variableValue.Length > 2 ? variableValue[1..^2] : string.Empty;
}
if (fileScopedVariablesEnded)
{
requestVariables ??= new();
Expand Down

0 comments on commit ccb605d

Please sign in to comment.