Skip to content

Commit 5b06a45

Browse files
committed
style: formatting
1 parent 81790df commit 5b06a45

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

β€Žscripts/my-github-prs.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env osascript -l JavaScript
2-
32
ObjC.import("stdlib");
43
const app = Application.currentApplication();
54
app.includeStandardAdditions = true;
5+
//──────────────────────────────────────────────────────────────────────────────
66

77
/** @param {string} str */
88
function alfredMatcher(str) {
@@ -66,7 +66,9 @@ function run() {
6666
repo,
6767
comments.toString(),
6868
`(${humanRelativeDate(item.created_at)})`,
69-
].filter(Boolean).join(" ");
69+
]
70+
.filter(Boolean)
71+
.join(" ");
7072

7173
return {
7274
title: draftIcon + title,

β€Žscripts/my-github-repos.js

+9-23
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ function alfredMatcher(str) {
1515
function httpRequest(url) {
1616
const queryURL = $.NSURL.URLWithString(url);
1717
const requestData = $.NSData.dataWithContentsOfURL(queryURL);
18-
const requestString = $.NSString.alloc.initWithDataEncoding(requestData, $.NSUTF8StringEncoding).js;
19-
return requestString;
18+
const requestStr = $.NSString.alloc.initWithDataEncoding(requestData, $.NSUTF8StringEncoding).js;
19+
return requestStr;
2020
}
2121

2222
//──────────────────────────────────────────────────────────────────────────────
@@ -71,13 +71,12 @@ function run() {
7171
.map((/** @type {GithubRepo&{local: {path: string}}} */ repo) => {
7272
let matcher = alfredMatcher(repo.name);
7373
let type = "";
74+
let subtitle = "";
7475

7576
// changes when repo is local
7677
repo.local = localRepos[repo.name];
7778
const mainArg = repo.local?.path || repo.html_url;
78-
const terminalActionDesc = repo.local
79-
? "Open in Terminal"
80-
: "Shallow Clone"
79+
const terminalActionDesc = repo.local ? "Open in Terminal" : "Shallow Clone";
8180
// open in terminal when local, clone when not
8281
const terminalArg = repo.local?.path || repo.html_url;
8382
if (repo.local) {
@@ -87,23 +86,10 @@ function run() {
8786
}
8887

8988
// extra info
90-
if (repo.archived) {
91-
type += "πŸ—„ ";
92-
matcher += "archived ";
93-
}
94-
if (repo.fork) {
95-
type += "🍴 ";
96-
matcher += "fork ";
97-
}
98-
if (repo.is_template) {
99-
type += "πŸ“„ ";
100-
matcher += "template ";
101-
}
102-
if (repo.private) {
103-
type += "πŸ”’ ";
104-
matcher += "private ";
105-
}
106-
let subtitle = "";
89+
if (repo.fork) type += "🍴 ";
90+
if (repo.fork) matcher += "fork ";
91+
if (repo.is_template) type += "πŸ“„ ";
92+
if (repo.is_template) matcher += "template ";
10793
if (repo.stargazers_count > 0) subtitle += `⭐ ${repo.stargazers_count} `;
10894
if (repo.open_issues > 0) subtitle += `🟒 ${repo.open_issues} `;
10995
if (repo.forks_count > 0) subtitle += `🍴 ${repo.forks_count} `;
@@ -120,7 +106,7 @@ function run() {
120106
valid: Boolean(repo.local),
121107
},
122108
ctrl: {
123-
subtitle: `βŒƒ: ${terminalActionDesc}`,
109+
subtitle: "βŒƒ: " + terminalActionDesc,
124110
arg: terminalArg,
125111
},
126112
alt: {

0 commit comments

Comments
Β (0)