fix(classes.dockerfile): use a single top-level fs import instead of requiring fs inside methods
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-01-21 - 1.4.2 - fix(classes.dockerfile)
|
||||||
|
use a single top-level fs import instead of requiring fs inside methods
|
||||||
|
|
||||||
|
- Added top-level import: import * as fs from 'fs' in ts/classes.dockerfile.ts
|
||||||
|
- Removed inline require('fs') calls and replaced with the imported fs in constructor and test() to keep imports consistent
|
||||||
|
- No behavioral change expected; this is a cleanup/refactor to standardize module usage
|
||||||
|
|
||||||
## 2026-01-20 - 1.4.1 - fix(docs)
|
## 2026-01-20 - 1.4.1 - fix(docs)
|
||||||
update README: expand usage, installation, quick start, features, troubleshooting and migration notes
|
update README: expand usage, installation, quick start, features, troubleshooting and migration notes
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsdocker',
|
name: '@git.zone/tsdocker',
|
||||||
version: '1.4.1',
|
version: '1.4.2',
|
||||||
description: 'develop npm modules cross platform with docker'
|
description: 'develop npm modules cross platform with docker'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { logger } from './tsdocker.logging.js';
|
|||||||
import { DockerRegistry } from './classes.dockerregistry.js';
|
import { DockerRegistry } from './classes.dockerregistry.js';
|
||||||
import type { IDockerfileOptions, ITsDockerConfig } from './interfaces/index.js';
|
import type { IDockerfileOptions, ITsDockerConfig } from './interfaces/index.js';
|
||||||
import type { TsDockerManager } from './classes.tsdockermanager.js';
|
import type { TsDockerManager } from './classes.tsdockermanager.js';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
|
||||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash',
|
executor: 'bash',
|
||||||
@@ -314,7 +315,6 @@ export class Dockerfile {
|
|||||||
this.containerName = 'dockerfile-' + this.version;
|
this.containerName = 'dockerfile-' + this.version;
|
||||||
|
|
||||||
if (options.filePath && options.read) {
|
if (options.filePath && options.read) {
|
||||||
const fs = require('fs');
|
|
||||||
this.content = fs.readFileSync(plugins.path.resolve(options.filePath), 'utf-8');
|
this.content = fs.readFileSync(plugins.path.resolve(options.filePath), 'utf-8');
|
||||||
} else if (options.fileContents) {
|
} else if (options.fileContents) {
|
||||||
this.content = options.fileContents;
|
this.content = options.fileContents;
|
||||||
@@ -419,7 +419,6 @@ export class Dockerfile {
|
|||||||
const testDir = this.managerRef.config.testDir || plugins.path.join(paths.cwd, 'test');
|
const testDir = this.managerRef.config.testDir || plugins.path.join(paths.cwd, 'test');
|
||||||
const testFile = plugins.path.join(testDir, 'test_' + this.version + '.sh');
|
const testFile = plugins.path.join(testDir, 'test_' + this.version + '.sh');
|
||||||
|
|
||||||
const fs = require('fs');
|
|
||||||
const testFileExists = fs.existsSync(testFile);
|
const testFileExists = fs.existsSync(testFile);
|
||||||
|
|
||||||
if (testFileExists) {
|
if (testFileExists) {
|
||||||
|
|||||||
Reference in New Issue
Block a user