Skip to content

Commit

Permalink
fix: invert size and last modified date on linux import script (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
cberthou committed Feb 4, 2021
1 parent 35cdf5e commit 31a85b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/load-filesystem.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
VERSION=1.0.0
VERSION=1.0.1

if [[ $1 = "" ]]
then
Expand All @@ -18,7 +18,7 @@ esac
if [[ $machine = Linux ]]
then
STAT="stat -c"
STAT_FORMAT="\"%n\",%Y,%s"
STAT_FORMAT="\"%n\",%s,%Y"
MD5=md5sum
else
STAT="stat -f"
Expand Down
8 changes: 4 additions & 4 deletions src/files-and-folders-loader/files-and-folders-loader.test.ts
Expand Up @@ -307,10 +307,10 @@ describe("files-and-folders-loader", () => {
const exportFileContent = `1.0.0
unix
/basePath/files
"/basePath/files/file.txt",5,1584108263,d8e8fca2dc0f896fd7cb4cb0031ba249
"/basePath/files/file",49,1563979128,0052aa96e1e52f1a0d6489731155dce3
"/basePath/files/file2",8196,1582727849,87706eb5706972ee4134891ca9cb6708
"/basePath/files/folder/file with space",49,1563979128,0052aa96e1e52f1a0d6489731155dce3
"/basePath/files/file.txt",1584108263,5,d8e8fca2dc0f896fd7cb4cb0031ba249
"/basePath/files/file",1563979128,49,0052aa96e1e52f1a0d6489731155dce3
"/basePath/files/file2",1582727849,8196,87706eb5706972ee4134891ca9cb6708
"/basePath/files/folder/file with space",1563979128,49,0052aa96e1e52f1a0d6489731155dce3
`;
const stream = Readable.from(exportFileContent);

Expand Down
6 changes: 6 additions & 0 deletions src/files-and-folders-loader/files-and-folders-loader.ts
Expand Up @@ -189,6 +189,12 @@ const LINE_LOADERS = {
// Whe take the last element as the rest, as the last modified date may be an integer or a float (randomly)
fileHash: rest[rest.length - 1],
}),
"unix-1.0.0": ([[filePath, fileLastModified, fileSize, fileHash]]) => ({
filePath,
fileLastModified,
fileSize,
fileHash,
}),
[latestVersion]: ([[filePath, fileSize, fileLastModified, fileHash]]) => ({
filePath,
fileSize,
Expand Down

0 comments on commit 31a85b7

Please sign in to comment.