Chapter 2: change back to use prettier
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const fs = require('fs')
|
||||
const file = './file.txt'
|
||||
const fs = require("fs");
|
||||
const file = "./file.txt";
|
||||
|
||||
fs.chmodSync(file, 0o664)
|
||||
fs.chmodSync(file, 0o664);
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
const fs = require('fs')
|
||||
const file = './file.txt'
|
||||
const fs = require("fs");
|
||||
const file = "./file.txt";
|
||||
|
||||
fs.chmodSync(file,
|
||||
fs.constants.S_IRUSR | fs.constants.S_IWUSR |
|
||||
fs.constants.S_IRGRP | fs.constants.S_IWGRP |
|
||||
fs.constants.S_IROTH)
|
||||
fs.chmodSync(
|
||||
file,
|
||||
fs.constants.S_IRUSR |
|
||||
fs.constants.S_IWUSR |
|
||||
fs.constants.S_IRGRP |
|
||||
fs.constants.S_IWGRP |
|
||||
fs.constants.S_IROTH
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const fs = require('fs')
|
||||
const file = process.argv[2]
|
||||
const fs = require("fs");
|
||||
const file = process.argv[2];
|
||||
|
||||
function printMetadata (file) {
|
||||
const fileStats = fs.statSync(file)
|
||||
console.log(fileStats)
|
||||
function printMetadata(file) {
|
||||
const fileStats = fs.statSync(file);
|
||||
console.log(fileStats);
|
||||
}
|
||||
|
||||
printMetadata(file)
|
||||
printMetadata(file);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
const fs = require('fs')
|
||||
const file = process.argv[2]
|
||||
const fs = require("fs");
|
||||
const file = process.argv[2];
|
||||
|
||||
function printMetadata (file) {
|
||||
function printMetadata(file) {
|
||||
try {
|
||||
const fileStats = fs.statSync(file)
|
||||
console.log(fileStats)
|
||||
const fileStats = fs.statSync(file);
|
||||
console.log(fileStats);
|
||||
} catch (err) {
|
||||
console.error('Error reading file path:', file)
|
||||
console.error("Error reading file path:", file);
|
||||
}
|
||||
}
|
||||
|
||||
printMetadata(file)
|
||||
printMetadata(file);
|
||||
|
||||
Reference in New Issue
Block a user