Skip to content

Commit

Permalink
server(filesystem): fix archive creation with ignore
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Penner <[email protected]>
  • Loading branch information
matthewpi committed Mar 14, 2024
1 parent 8f12993 commit 979df34
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 1 deletion.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
85 changes: 85 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
description = "Wings";

inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = {...} @ inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"];

imports = [
inputs.treefmt-nix.flakeModule
];

perSystem = {system, ...}: let
pkgs = import inputs.nixpkgs {inherit system;};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_22
gofumpt
golangci-lint
gotools
];
};

treefmt = {
projectRootFile = "flake.nix";

programs = {
alejandra.enable = true;
deadnix.enable = true;
gofumpt = {
enable = true;
extra = true;
};
shellcheck.enable = true;
shfmt = {
enable = true;
indent_size = 0; # 0 causes shfmt to use tabs
};
yamlfmt.enable = true;
};
};
};
};
}
2 changes: 1 addition & 1 deletion server/filesystem/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (a *Archive) Stream(ctx context.Context, w io.Writer) error {
i := ignore.CompileIgnoreLines(strings.Split(a.Ignore, "\n")...)
callback = a.callback(func(_ int, _, relative string, _ ufs.DirEntry) error {
if i.MatchesPath(relative) {
return ufs.SkipDir
return SkipThis
}
return nil
})
Expand Down

0 comments on commit 979df34

Please sign in to comment.