* Recursively push all files in a local folder to the repo. * Skips .git, node_modules, etc. (configurable)
(
installationToken: string,
owner: string,
repo: string,
folderPath: string,
basePathInRepo: string, // e.g. "" or "backend"
)
| 234 | // * Skips .git, node_modules, etc. (configurable) |
| 235 | // */ |
| 236 | // async pushFolderContent( |
| 237 | // installationToken: string, |
| 238 | // owner: string, |
| 239 | // repo: string, |
| 240 | // folderPath: string, |
| 241 | // basePathInRepo: string, // e.g. "" or "backend" |
| 242 | // ) { |
| 243 | // const entries = fs.readdirSync(folderPath, { withFileTypes: true }); |
| 244 | |
| 245 | // for (const entry of entries) { |
| 246 | // // Skip unwanted files |
| 247 | // if (this.ignored.includes(entry.name)) { |
| 248 | // continue; |
| 249 | // } |
| 250 | |
| 251 | // const entryPath = path.join(folderPath, entry.name); |
| 252 | // if (entry.isDirectory()) { |
| 253 | // // Skip unwanted directories |
| 254 | // if (entry.name === '.git' || entry.name === 'node_modules') { |
| 255 | // continue; |
| 256 | // } |
| 257 | // // Recurse into subdirectory |
| 258 | // const subDirInRepo = path |
| 259 | // .join(basePathInRepo, entry.name) |
| 260 | // .replace(/\\/g, '/'); |
| 261 | // await this.pushFolderContent( |
| 262 | // installationToken, |
| 263 | // owner, |
| 264 | // repo, |
| 265 | // entryPath, |
| 266 | // subDirInRepo, |
| 267 | // ); |
| 268 | // } else { |
| 269 | // // It's a file; push it |
| 270 | // const fileInRepo = path |
| 271 | // .join(basePathInRepo, entry.name) |
| 272 | // .replace(/\\/g, '/'); |
| 273 | // await this.pushFileContent( |
| 274 | // installationToken, |
| 275 | // owner, |
| 276 | // repo, |
| 277 | // entryPath, |
| 278 | // fileInRepo, |
| 279 | // `Add file: ${fileInRepo}`, |
| 280 | // ); |
| 281 | // } |
| 282 | // } |
| 283 | // } |
| 284 | // } |
no test coverage detected