Skip to content

Commit

Permalink
refactor: Update imports and class names in ipfs_model_manager.js
Browse files Browse the repository at this point in the history
  • Loading branch information
endomorphosis committed Aug 16, 2024
1 parent 162b859 commit 8dde141
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ipfs_model_manager_js/s3_kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@ import path from 'path';
import os from 'os';
import util from 'util';
import { ObjectLockEnabled } from '@aws-sdk/client-s3';
import { requireConfig } from '../config/config.js';

export class s3Kit {
constructor(resources, meta = null) {
this.thisDir = path.dirname(import.meta.url);
if (this.thisDir.startsWith("file://")) {
this.thisDir = this.thisDir.replace("file://", "");
}
this.parentDir = path.dirname(this.thisDir);
if (fs.existsSync(path.join(this.parentDir, "config", "config.toml"))) {
this.config = new requireConfig({config: path.join(this.parentDir, "config", "config.toml")});
}
else{
// this.config = new requireConfig();
}
this.bucket = null;
this.bucketFiles = null;
this.cpDir = this.s3CpDir;
Expand Down

0 comments on commit 8dde141

Please sign in to comment.