15 lines
511 B
JavaScript
15 lines
511 B
JavaScript
|
import { promisify } from 'util';
|
||
|
import { exec } from 'child_process';
|
||
|
|
||
|
const execPromise = promisify(exec);
|
||
|
|
||
|
/** @type {import('./$types').PageServerLoad} */
|
||
|
export async function load({ params }) {
|
||
|
return {
|
||
|
info: (await execPromise('neofetch --stdout')).stdout,
|
||
|
when: Date.now(),
|
||
|
hash: (await execPromise('git rev-parse HEAD')).stdout,
|
||
|
branch: (await execPromise('git rev-parse --abbrev-ref HEAD')).stdout,
|
||
|
remote: (await execPromise('git config --get remote.origin.url')).stdout
|
||
|
};
|
||
|
}
|