Skip to content

Commit 9844e78

Browse files
Fit submodule to AdminJS dev workspace (#38)
* chore: fit submodule to AdminJS dev workspace * chore: fixed linting
1 parent 8dad188 commit 9844e78

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "MIT",
99
"scripts": {
1010
"release": "semantic-release",
11-
"build": "yarn tsc",
11+
"build": "tsc",
1212
"clean": "rm -fr build && mkdir build && rm -fr types && mkdir types",
1313
"dev": "yarn clean && tsc --watch",
1414
"test": "TS_NODE_FILES=true mocha -r ts-node/register ./src/**/*.spec.ts",

src/features/upload-file/providers/local-provider.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,24 @@ export class LocalProvider extends BaseProvider {
2727

2828
public async upload(file: UploadedFile, key: string): Promise<any> {
2929
const filePath = process.platform === 'win32'
30-
? this.path(key) : this.path(key).slice(1); // adjusting file path according to OS
30+
? this.path(key) : this.path(key).slice(1) // adjusting file path according to OS
3131

32-
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
33-
await fs.promises.rename(file.path, filePath);
32+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true })
33+
await fs.promises.rename(file.path, filePath)
3434
}
3535

3636
public async delete(key: string, bucket: string): Promise<any> {
37-
await fs.promises.unlink(process.platform === 'win32'
38-
? this.path(key, bucket) : this.path(key, bucket).slice(1)); // adjusting file path according to OS
37+
await fs.promises.unlink(
38+
process.platform === 'win32'
39+
? this.path(key, bucket)
40+
: this.path(key, bucket).slice(1),
41+
) // adjusting file path according to OS
3942
}
4043

4144
// eslint-disable-next-line class-methods-use-this
4245
public path(key: string, bucket?: string): string {
4346
// Windows doesn't requires the '/' in path, while UNIX system does
4447
return process.platform === 'win32' ? `${path.join(bucket || this.bucket, key)}`
45-
: `/${path.join(bucket || this.bucket, key)}`;
48+
: `/${path.join(bucket || this.bucket, key)}`
4649
}
4750
}

0 commit comments

Comments
 (0)