Skip to content

Commit

Permalink
Debugging read files problems
Browse files Browse the repository at this point in the history
  • Loading branch information
sebryu committed Sep 25, 2023
1 parent 7bd1e44 commit c8731df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,17 @@ function detectReactComponent(code) {
};

function readFile(filename) {
const filePath = `./${filename}`;
const filePath = path.resolve(__dirname, `../../../../${filename}`);
try {
console.log('reading', filePath, fs.existsSync('./package.json'));
console.log('reading', filePath, fs.existsSync('../../../../package.json'), fs.existsSync('../../../package.json'), fs.existsSync('../../package.json'), fs.existsSync('../package.json'));
return fs.readFileSync(filePath, 'utf-8');
} catch (error) {
console.error(`Error reading ${filePath}`, error);
}
}

function detectFunction(changedFiles) {
console.log('detectFunction', process.cwd());
console.log('detectFunction', process.cwd(), __dirname);

fs.readdirSync(process.cwd()).forEach(file => {
console.log(file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ function detectReactComponent(code) {
};

function readFile(filename) {
const filePath = `./${filename}`;
const filePath = path.resolve(__dirname, `../../../../${filename}`);
try {
console.log('reading', filePath, fs.existsSync('./package.json'));
console.log('reading', filePath, fs.existsSync('../../../../package.json'), fs.existsSync('../../../package.json'), fs.existsSync('../../package.json'), fs.existsSync('../package.json'));
return fs.readFileSync(filePath, 'utf-8');
} catch (error) {
console.error(`Error reading ${filePath}`, error);
}
}

function detectFunction(changedFiles) {
console.log('detectFunction', process.cwd());
console.log('detectFunction', process.cwd(), __dirname);

fs.readdirSync(process.cwd()).forEach(file => {
console.log(file);
Expand Down

0 comments on commit c8731df

Please sign in to comment.