Skip to content

Commit

Permalink
return the commit id
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Nov 21, 2024
1 parent 13a7ea5 commit 38265d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions src/Speckle.WebIfc.Importer/Import.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
using Speckle.Sdk.Common;
using Speckle.Sdk.Credentials;
using Speckle.Sdk.Host;
using Speckle.Sdk.Models;
Expand All @@ -22,7 +21,7 @@ namespace Speckle.WebIfc.Importer;

public static class Import
{
public static async Task Ifc(
public static async Task<string> Ifc(
string url,
string filePath,
string streamId,
Expand All @@ -33,7 +32,16 @@ public static async Task Ifc(
)
{
var serviceProvider = GetServiceProvider();
await Ifc(serviceProvider, url, filePath, streamId, modelId, commitMessage, token, progress);
return await Ifc(
serviceProvider,
url,
filePath,
streamId,
modelId,
commitMessage,
token,
progress
);
}

public static ServiceProvider GetServiceProvider()
Expand All @@ -46,7 +54,7 @@ public static ServiceProvider GetServiceProvider()
return serviceCollection.BuildServiceProvider();
}

public static async Task Ifc(
public static async Task<string> Ifc(
IServiceProvider serviceProvider,
string url,
string filePath,
Expand Down Expand Up @@ -98,11 +106,12 @@ public static async Task Ifc(

// 8 - Create the version (commit)
using var apiClient = clientFactory.Create(account);
_ = await apiClient.Version.Create(
var commitId = await apiClient.Version.Create(
new CreateVersionInput(rootId, modelId, streamId, message: commitMessage)
);
ms = ms2;
ms2 = stopwatch.ElapsedMilliseconds;
Console.WriteLine($"Committed to Speckle: {ms2 - ms} ms");
return commitId;
}
}
2 changes: 1 addition & 1 deletion src/Speckle.WebIfc.Importer/Speckle.WebIfc.Importer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PropertyGroup Label="Nuget Package Properties">
<IsPackable>true</IsPackable>
<IncludeSymbols>true</IncludeSymbols>
<version>0.0.2</version>
<version>0.0.3</version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 38265d6

Please sign in to comment.