Skip to content

Commit

Permalink
Update the reMigrate command and publish new version
Browse files Browse the repository at this point in the history
  • Loading branch information
andyduong1920 committed Aug 7, 2023
1 parent 9f20909 commit 7447d51
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 46 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

on:
push:
workflow_dispatch:

env:
DOCKER_REGISTRY_HOST: ${{ secrets.HEROKU_REGISTRY_HOST }}
DOCKER_IMAGE: ${{ github.repository }}
DOCKER_REGISTRY_USERNAME: ${{ github.repository_owner }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
PHRASE_CLI_VERSION: "2.5.0"
PHRASE_ACCESS_TOKEN: ${{ secrets.PHRASE_ACCESS_TOKEN }}

jobs:
deploy:
name: Deploy the application to Heroku
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch || github.ref }}

-
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ install:
rm bar-helper-0.4.0.vsix

package_and_install: compile package install

compile_and_package: compile package

publish:
vsce publish
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ Run the test from the `Status bar` or `Menu`
### II/ Use

1. Install it on [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=andyduong1920.bar-helper)

### III/ Publish

1. Run `make compile_and_package`
2. Run `make publish`
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bar-helper",
"displayName": "Bar Helper",
"description": "Run any command from the status bar.",
"version": "0.4.0",
"version": "0.4.1",
"publisher": "andyduong1920",
"repository": {
"type": "git",
Expand All @@ -23,10 +23,8 @@
"properties": {}
},
"menus": {
"editor/context": [
],
"explorer/context": [
]
"editor/context": [],
"explorer/context": []
},
"keybindings": [
{
Expand Down
56 changes: 15 additions & 41 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const formatCodeFileItem = window.createStatusBarItem(
StatusBarAlignment.Left,
-3
);
const runDBMigrateItem = window.createStatusBarItem(StatusBarAlignment.Left, -4);
const runDBMigrateItem = window.createStatusBarItem(
StatusBarAlignment.Left,
-4
);
const startInteractiveConsoleItem = window.createStatusBarItem(
StatusBarAlignment.Left,
-5
Expand All @@ -27,14 +30,8 @@ const runDBRemigrateItem = window.createStatusBarItem(
StatusBarAlignment.Left,
-7
);
const gitFetchItem = window.createStatusBarItem(
StatusBarAlignment.Left,
-9
);
const gitPushItem = window.createStatusBarItem(
StatusBarAlignment.Left,
-10
);
const gitFetchItem = window.createStatusBarItem(StatusBarAlignment.Left, -9);
const gitPushItem = window.createStatusBarItem(StatusBarAlignment.Left, -10);

// Right side
const gitRebaseSkipItem = window.createStatusBarItem(
Expand Down Expand Up @@ -149,18 +146,8 @@ const setupItem = (

export function activate(context: ExtensionContext) {
// Adjust here to add more items
setupItem(
runTestFileItem,
"🔥⌃a",
"Test file",
"barHelper.runTestFile"
);
setupItem(
runTestLineItem,
"1️⃣ ⌃z",
"Test line",
"barHelper.runTestLine"
);
setupItem(runTestFileItem, "🔥⌃a", "Test file", "barHelper.runTestFile");
setupItem(runTestLineItem, "1️⃣ ⌃z", "Test line", "barHelper.runTestLine");
setupItem(
runDBRemigrateItem,
"⭕ reMIGRATION",
Expand All @@ -185,24 +172,9 @@ export function activate(context: ExtensionContext) {
"format the file",
"barHelper.formatCodeFile"
);
setupItem(
runDBMigrateItem,
"⬆️ ⌃m",
"db:migrate",
"barHelper.runDBMigrate"
);
setupItem(
gitPushItem,
"🚀⌃u",
"git push --force",
"barHelper.runGitPush"
);
setupItem(
gitFetchItem,
"⏬ FETCH",
"git fetch.",
"git.fetch"
);
setupItem(runDBMigrateItem, "⬆️ ⌃m", "db:migrate", "barHelper.runDBMigrate");
setupItem(gitPushItem, "🚀⌃u", "git push --force", "barHelper.runGitPush");
setupItem(gitFetchItem, "⏬ FETCH", "git fetch.", "git.fetch");
setupItem(
gitRebaseContinueItem,
"🏃 rebase:CONTINUE",
Expand All @@ -224,7 +196,7 @@ export function activate(context: ExtensionContext) {
gitPushItem,
gitFetchItem,
gitRebaseContinueItem,
gitRebaseSkipItem
gitRebaseSkipItem,
]);

const runTestFileCommand = commands.registerCommand(
Expand Down Expand Up @@ -272,7 +244,9 @@ export function activate(context: ExtensionContext) {
"barHelper.runDBRemigrate",
() => {
// TODO: Support Elixir
sendToTerminal("bundle exec rails db:drop db:create db:migrate && bundle exec rails db:seed");
sendToTerminal(
"bin/rails db:environment:set RAILS_ENV=development && bin/rails db:drop db:setup"
);
}
);

Expand Down

0 comments on commit 7447d51

Please sign in to comment.