mirror of
https://github.com/bendtherules/github-delete-unused-repos.git
synced 2026-08-18 13:52:59 +00:00
Export main 2 functions from gh + Use in index
Also reformatted gh
This commit is contained in:
@@ -73,7 +73,7 @@ interface ResponseWithMetaLink {
|
||||
|
||||
interface ResponseWithDataArrayAndMeta<T>
|
||||
extends ResponseWithDataArray<T>,
|
||||
ResponseWithMetaLink {}
|
||||
ResponseWithMetaLink { }
|
||||
|
||||
interface ResponseFromGetUserRepo extends ResponseWithMetaLink {
|
||||
data: RepoFromGetUserRepo[];
|
||||
@@ -163,7 +163,7 @@ interface RepoNameWithParentRepo {
|
||||
|
||||
interface RepoNameWithBranchesAndParent
|
||||
extends RepoNameWithBranches,
|
||||
RepoNameWithParentRepo {}
|
||||
RepoNameWithParentRepo { }
|
||||
|
||||
const username = 'rousan';
|
||||
|
||||
@@ -358,7 +358,7 @@ async function fetchUserIsNotContributor(
|
||||
};
|
||||
}
|
||||
|
||||
async function fetchUnusedForkedRepos() {
|
||||
export async function fetchUnusedForkedRepos() {
|
||||
const params: Octokit.ReposGetForUserParams = {
|
||||
username,
|
||||
};
|
||||
@@ -514,10 +514,13 @@ async function fetchUnusedForkedRepos() {
|
||||
return unusedRepoNames;
|
||||
}
|
||||
|
||||
fetchUnusedForkedRepos().then(unusedRepoNames => {
|
||||
|
||||
export function runMain() {
|
||||
fetchUnusedForkedRepos().then(unusedRepoNames => {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log(unusedRepoNames);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Next steps
|
||||
//
|
||||
|
||||
+4
-1
@@ -1,8 +1,10 @@
|
||||
import { Greeter } from './greeter';
|
||||
// tslint:disable-next-line:ordered-imports
|
||||
import { fetchUnusedForkedRepos, runMain } from './gh';
|
||||
export * from './greeter';
|
||||
|
||||
// tslint:disable-next-line:only-arrow-functions
|
||||
(function(currentWindow: Window) {
|
||||
(function (currentWindow: Window) {
|
||||
// execute when load index.js
|
||||
|
||||
// tslint:disable-next-line:no-console
|
||||
@@ -11,6 +13,7 @@ export * from './greeter';
|
||||
// assign Greeter to global
|
||||
const myWindow = currentWindow as any;
|
||||
myWindow.Greeter = Greeter;
|
||||
myWindow.runMain = runMain;
|
||||
// we can use Greeter , execute following in console
|
||||
// var greet = new Greeter('myName');
|
||||
// greet.greet();
|
||||
|
||||
Reference in New Issue
Block a user