HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/tana/frontend/node_modules/browser-sync/changelog.js
const {execSync} = require('child_process');
let [start, end] = process.argv.slice(2);
if (!start || !end)  {
    console.error('Must provide start and end tags');
    console.error('  eg: v1.0 HEAD');
    console.error('  eg: v1.0 v2.0');
    process.exit(1);
}
const separator = `===END===`;
const res = execSync(`git log -E --format=%H%n%s%b===END=== ${start}..${end}`);
const sep = res.toString().split(separator);
const output = sep
    .map((item, i) => {
        const [hash, ...body] = getParts(item, i);
        const bodyJoined = body.join('\n');
        return [hash, bodyJoined];
    })
    // .filter(([, body]) => )
    .map(([hash, bodyJoined]) => {
        const hasSection = /^[\w]+: [^ ]/.test(bodyJoined);
        if (hasSection) {
            const [section, body] = bodyJoined.split(/: /);
            return [hash, section, body];
        }
        return [hash, 'misc', bodyJoined];
    })
    .reduce((acc, item) => {
        const [, section] = item;
        if (!acc[section]) {
            acc[section] = [item];
        } else {
            acc[section].push(item);
        }
        return acc;
    }, {});

if (process.argv.indexOf('--json') > -1) {
    console.log(JSON.stringify(output, null, 2));
} else {
    Object.keys(output)
        .map(x => [x, output[x]])
        .forEach(([section, items]) => {
            const header = `**${section}**`;
            console.log(header);
            items.forEach(([hash, section, body]) => {
                console.log(`- ${body} ${hash}`)
            });
            console.log('')
        });
}



function getParts(item, index) {
    const segs = item.split('\n');
    if (index === 0) return segs;
    return segs.slice(1);
}