mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2025-06-22 12:32:09 +10:00
add logs
This commit is contained in:
parent
935fc586de
commit
85dc1a16ee
2 changed files with 6 additions and 5 deletions
|
@ -3,17 +3,17 @@ const { join } = require('path');
|
|||
|
||||
const validateDir = (dir) => {
|
||||
if (!dir) {
|
||||
console.log('[SSH] dir is not defined');
|
||||
console.log('[DIR] dir is not defined');
|
||||
return;
|
||||
}
|
||||
if (existsSync(dir)) {
|
||||
console.log(`[SSH] ${dir} dir exist`);
|
||||
console.log(`[DIR] ${dir} dir exist`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`[SSH] Creating ${dir} dir in workspace root`);
|
||||
console.log(`[DIR] Creating ${dir} dir in workspace root`);
|
||||
mkdirSync(dir);
|
||||
console.log('✅ [SSH] dir created.');
|
||||
console.log('✅ [DIR] dir created.');
|
||||
};
|
||||
|
||||
const writeToFile = ({ dir, filename, content, isRequired }) => {
|
||||
|
@ -29,6 +29,7 @@ const writeToFile = ({ dir, filename, content, isRequired }) => {
|
|||
}
|
||||
|
||||
try {
|
||||
console.log(`[FILE] writing ${filePath} file ...`, content.length);
|
||||
writeFileSync(filePath, content, {
|
||||
encoding: 'utf8',
|
||||
mode: 0o600
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue