@@ -66,7 +66,7 @@ function run(argv) {
6666 }
6767
6868 // DOCS https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-repositories
69- const apiUrl = ` https://api.github.com/search/repositories?q=${ encodeURIComponent ( query ) } ` ;
69+ const apiUrl = " https://api.github.com/search/repositories?q=" + encodeURIComponent ( query ) ;
7070 const response = httpRequest ( apiUrl ) ;
7171 if ( ! response ) {
7272 return JSON . stringify ( {
@@ -81,45 +81,50 @@ function run(argv) {
8181 const shallowClone = cloneDepth > 0 ;
8282
8383 /** @type {AlfredItem[] } */
84- const repos = JSON . parse ( response )
85- . items . filter ( ( /** @type {GithubRepo } */ repo ) => ! ( repo . fork || repo . archived ) )
86- . map ( ( /** @type {GithubRepo } */ repo ) => {
87- // calculate relative date
88- // INFO pushed_at refers to commits only https://github.com/orgs/community/discussions/24442
89- // CAVEAT pushed_at apparently also includes pushes via PR :(
90- const lastUpdated = repo . pushed_at ? humanRelativeDate ( repo . pushed_at ) : "" ;
91-
92- const subtitle = [
93- repo . owner . login ,
94- "★ " + shortNumber ( repo . stargazers_count ) ,
95- lastUpdated ,
96- repo . description ,
97- ]
98- . filter ( Boolean )
99- . join ( " · " ) ;
100-
101- let cloneSubtitle = shallowClone ? `⌃: Shallow Clone (depth ${ cloneDepth } )` : "⌃: Clone" ;
102- if ( forkOnClone ) cloneSubtitle += " & Fork" ;
103-
104- const secondUrl = repo . homepage || repo . html_url + "/releases" ;
105-
106- return {
107- title : repo . name ,
108- subtitle : subtitle ,
109- match : alfredMatcher ( repo . name ) ,
110- arg : repo . html_url ,
111- quicklookurl : repo . html_url ,
112- mods : {
113- cmd : {
114- arg : secondUrl ,
115- subtitle : `⌘: Open "${ secondUrl } "` ,
116- } ,
117- ctrl : {
118- subtitle : cloneSubtitle ,
119- } ,
84+ const repos = JSON . parse ( response ) . items . map ( ( /** @type {GithubRepo } */ repo ) => {
85+ // calculate relative date
86+ // INFO pushed_at refers to commits only https://github.com/orgs/community/discussions/24442
87+ // CAVEAT pushed_at apparently also includes pushes via PR :(
88+ const lastUpdated = repo . pushed_at ? humanRelativeDate ( repo . pushed_at ) : "" ;
89+
90+ let matcher = alfredMatcher ( repo . name ) ;
91+ let type = "" ;
92+ if ( repo . fork ) type += "🍴 " ;
93+ if ( repo . fork ) matcher += "fork " ;
94+ if ( repo . archived ) type += "🗄️ " ;
95+ if ( repo . archived ) matcher += "archived " ;
96+
97+ const subtitle = [
98+ repo . owner . login ,
99+ "★ " + shortNumber ( repo . stargazers_count ) ,
100+ lastUpdated ,
101+ repo . description ,
102+ ]
103+ . filter ( Boolean )
104+ . join ( " · " ) ;
105+
106+ let cloneSubtitle = shallowClone ? `⌃: Shallow Clone (depth ${ cloneDepth } )` : "⌃: Clone" ;
107+ if ( forkOnClone ) cloneSubtitle += " & Fork" ;
108+
109+ const secondUrl = repo . homepage || repo . html_url + "/releases" ;
110+
111+ return {
112+ title : type + repo . name ,
113+ subtitle : subtitle ,
114+ match : matcher ,
115+ arg : repo . html_url ,
116+ quicklookurl : repo . html_url ,
117+ mods : {
118+ cmd : {
119+ arg : secondUrl ,
120+ subtitle : `⌘: Open "${ secondUrl } "` ,
120121 } ,
121- } ;
122- } ) ;
122+ ctrl : {
123+ subtitle : cloneSubtitle ,
124+ } ,
125+ } ,
126+ } ;
127+ } ) ;
123128
124129 // GUARD no results
125130 if ( repos . length === 0 ) {
0 commit comments