Skip to content

Commit

Permalink
add if
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Dec 11, 2023
1 parent 438f3f3 commit 1d72553
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/starsky-docker-buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: TOOLS=true

- name: Build and don't push
id: docker_build_pull_request
Expand Down
15 changes: 10 additions & 5 deletions starsky/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,16 @@ RUN if [ "$TEST" = "true" ]; then \
# docker buildx imagetools inspect mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS release
WORKDIR /app

# for debugging
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get clean
ARG TOOLS=false

# # for debugging
RUN if [ "$TOOLS" = "true" ]; then \
apt-get update ;\
apt-get install --no-install-recommends -y curl ;\
apt-get clean ;\
else \
echo "no tools for debug" ;\
fi

# Create a group and user
RUN groupadd --gid 1000 app \
Expand Down
2 changes: 1 addition & 1 deletion starsky/starskytest/Controllers/DiskControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public DiskControllerTest()
_appSettings = serviceProvider.GetRequiredService<AppSettings>();

_scopeFactory = serviceProvider.GetRequiredService<IServiceScopeFactory>();
_query = new Query(_context, new AppSettings(), _scopeFactory, new FakeIWebLogger(), memoryCache);
_query = new Query(_context, _appSettings, _scopeFactory, new FakeIWebLogger(), memoryCache);
}

private async Task<FileIndexItem> InsertSearchData()
Expand Down
4 changes: 2 additions & 2 deletions starsky/starskytest/FakeMocks/FakeIQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public IEnumerable<FileIndexItem> DisplayFileFolders(List<FileIndexItem> fileInd
bool enableCollections = true, bool hideDeleted = true,
SortType? sort = SortType.FileName)
{
if ( _content.All(p => p.FilePath != singleItemDbPath) )
if ( _content.TrueForAll(p => p.FilePath != singleItemDbPath) )
{
return null;
}
Expand Down Expand Up @@ -234,7 +234,7 @@ public async Task<List<FileIndexItem>> RemoveItemAsync(List<FileIndexItem> updat
public bool RemoveCacheParentItem(string directoryName)
{
if ( _fakeCachedContent == null ) return false;
var item = _fakeCachedContent.FirstOrDefault(p =>
var item = _fakeCachedContent.Find(p =>
p.ParentDirectory == directoryName);
if ( item == null ) return false;
_fakeCachedContent.Remove(item);
Expand Down

0 comments on commit 1d72553

Please sign in to comment.