Skip to content

Commit

Permalink
debug ci
Browse files Browse the repository at this point in the history
Signed-off-by: yolossn <sannagaraj@microsoft.com>
  • Loading branch information
yolossn committed Jul 1, 2024
1 parent d55768a commit 71c03be
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/headlamp-plugin/headlamp-plugin-management.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { execSync } = require('child_process');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const envPaths = require('env-paths');

// Helper function to run CLI commands and return the output
function runCommand(command) {
Expand All @@ -11,6 +14,20 @@ function runCommand(command) {
}
}

// Helper function to get the default plugins directory
function defaultPluginsDir() {
const paths = envPaths('Headlamp', { suffix: '' });
const configDir = fs.existsSync(paths.data) ? paths.data : paths.config;
return path.join(configDir, 'plugins');
}


// create default plugins directory if it doesn't exist
const pluginsDir = defaultPluginsDir();
if (!fs.existsSync(pluginsDir)) {
fs.mkdirSync(pluginsDir, { recursive: true });
}

// List plugins initially
let output = runCommand('node ./bin/headlamp-plugin.js list --json');
console.log('Initial list output:', output);
Expand Down

0 comments on commit 71c03be

Please sign in to comment.