Skip to content

Commit

Permalink
feat(noexist_library): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ncqwer committed Feb 26, 2024
1 parent 0522fcb commit 042e187
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions scripts/utils/isPackageExist.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
const fsp = require('fs').promises;
const path = require('path');

module.exports.isPackageExist = async (libraryName) => {
const isPackageExist = async (libraryName) => {
const [prefix] = libraryName.split(/[\-\_]/);

const targetPackagesDir = path.join(
'.',
'packages',
prefix.length === libraryName.length ? '' : prefix,
libraryName
);
let targetPackagesDir = path.join('.', 'packages', prefix.length === libraryName.length ? '' : prefix, libraryName);
try {
await fsp.access(
targetPackagesDir,
fsp.constants.R_OK | fsp.constants.W_OK
);
await fsp.access(targetPackagesDir, fsp.constants.R_OK | fsp.constants.W_OK);
return targetPackagesDir;
} catch {
return null;
try {
targetPackagesDir = path.join('.', libraryName);
await fsp.access(targetPackagesDir, fsp.constants.R_OK | fsp.constants.W_OK);
return targetPackagesDir;
} catch {
return null;
}
}
};

module.exports.isPackageExist = isPackageExist;

// isPackageExist('noexist_library').then((v) => console.log(v));
2 changes: 1 addition & 1 deletion scripts/utils/updatePR.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports.updatePullRequest = async (content) => {
};
console.log('pull number', pullRequestNumber);

const response = await fetch('https://api.github.com/repos/vusion/cloud-ui/pull/${pullRequestNumber}', {
const response = await fetch('https://api.github.com/repos/vusion/cloud-ui-materials/pull/${pullRequestNumber}', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Expand Down

0 comments on commit 042e187

Please sign in to comment.