Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Plugin: Update go sdk when running update cmd #1143

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/create-plugin/src/commands/generate.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { renderTemplateFromFile, getTemplateData } from '../utils/utils.template
import { prettifyFiles } from '../utils/utils.prettifyFiles.js';
import { printGenerateSuccessMessage } from './generate/print-success-message.js';
import { promptUser } from './generate/prompt-user.js';
import { updateGoSdkAndModules } from './generate/update-go-sdk-and-packages.js';
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
import { TemplateData } from '../types.js';

export const generate = async (argv: minimist.ParsedArgs) => {
Expand Down
16 changes: 9 additions & 7 deletions packages/create-plugin/src/commands/update.command.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import minimist from 'minimist';
import chalk from 'chalk';
import { printRedBox, printBlueBox } from '../utils/utils.console.js';
import { updatePackageJson, updateNpmScripts } from '../utils/utils.npm.js';
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js';
import { getVersion, getGrafanaRuntimeVersion } from '../utils/utils.version.js';
import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js';
import minimist from 'minimist';
import { UDPATE_CONFIG } from '../constants.js';
import { printBlueBox, printRedBox } from '../utils/utils.console.js';
import { getOnlyExistingInCwd, removeFilesInCwd } from '../utils/utils.files.js';
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
import { updateNpmScripts, updatePackageJson } from '../utils/utils.npm.js';
import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js';
import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js';
import { getGrafanaRuntimeVersion, getVersion } from '../utils/utils.version.js';

export const update = async (argv: minimist.ParsedArgs) => {
const { packageManagerName } = getPackageManagerFromUserAgent();
Expand Down Expand Up @@ -55,6 +56,7 @@ In case you want to proceed as is please use the ${chalk.bold('--force')} flag.)
onlyOutdated: true,
ignoreGrafanaDependencies: false,
});
await updateGoSdkAndModules(process.cwd());

const filesToRemove = getOnlyExistingInCwd(UDPATE_CONFIG.filesToRemove);
if (filesToRemove.length) {
Expand Down
Loading