feat: 🔊 added logs on actual
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import chalk from 'chalk';
|
||||
import api from '@actual-app/api';
|
||||
|
||||
import { checkEnv } from './env.js';
|
||||
import pckg from '../package.json' with { type: 'json' };
|
||||
|
||||
checkEnv([
|
||||
'ACTUAL_URL',
|
||||
@@ -9,12 +11,17 @@ checkEnv([
|
||||
'ACTUAL_ID'
|
||||
]);
|
||||
|
||||
console.log(chalk.grey(`Connecting to Actual ${chalk.underline(process.env.ACTUAL_URL)}@${pckg.dependencies['@actual-app/api']}...`));
|
||||
await api.init({
|
||||
dataDir: './data',
|
||||
serverURL: process.env.ACTUAL_URL,
|
||||
password: process.env.ACTUAL_PASSWORD,
|
||||
});
|
||||
|
||||
// console.log(chalk.grey(`Syncing files...`));
|
||||
// await api.sync();
|
||||
|
||||
console.log(chalk.grey(`Downloading budget ${chalk.underline(process.env.ACTUAL_ID)}...`));
|
||||
await api.downloadBudget(process.env.ACTUAL_ID, {
|
||||
password: process.env.ACTUAL_ENCRYPTION,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user