Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1374645
index.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
index.ts
View Options
#!/usr/bin/env ts-node
import
*
as
os
from
"os"
;
import
*
as
fs
from
"fs"
;
import
*
as
path
from
"path"
;
import
*
as
util
from
"util"
;
import
axios
from
"axios"
;
import
*
as
childProcess
from
"child_process"
;
// TODO(itsromek): Move this to some config file
const
API
=
"https://hub.sealcode.org/api/"
;
const
queryKey
=
"dTaNeNuwKB7l"
;
const
readFile
=
util
.
promisify
(
fs
.
readFile
);
const
writeFile
=
util
.
promisify
(
fs
.
writeFile
);
const
exec
=
util
.
promisify
(
childProcess
.
exec
);
import
initConfig
from
"../lib/init"
;
// async function getData(): Promise<{ [key: string]: Task }> {
// const results: { [key: string]: Task } = {};
// const apiToken = await resolveAPIToken();
// const res = await axios.get(API + "maniphest.search", {
// data: `api.token=${apiToken}`,
// });
// res.data.result.data.forEach((item: responseItem) => {
// const taskID = "T" + item.id;
// results[taskID] = {
// description: item.fields.name,
// cmd: `xdg-open https://hub.sealcode.org/${taskID}`,
// };
// });
// console.log(results);
// return results;
// }
(
async
function
main
()
{
//const data = await getData();
if
(
process
.
argv
.
includes
(
"--init"
))
{
return
await
initConfig
();
}
// await writeFile(
// path.resolve(os.homedir(), ".config/rofi-json-menu"),
// JSON.stringify(data)
// );
//exec("rofi -modi json-menu -show json-menu");
})();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 25, 04:37 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
610455
Default Alt Text
index.ts (1 KB)
Attached To
Mode
rROFI Roficator
Attached
Detach File
Event Timeline
Log In to Comment