Skip to content

Commit

Permalink
Merge e07fb52 into 5560298
Browse files Browse the repository at this point in the history
  • Loading branch information
upupming committed Aug 21, 2021
2 parents 5560298 + e07fb52 commit 4d29687
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ coverage
dist
tmp
assets/test.md
*.zip
16 changes: 16 additions & 0 deletions .scripts/update_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# https://gist.github.com/sindresorhus/7996717
# https://gist.github.com/GianlucaGuarini/8001627

# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.

changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}

# run yarn when yarn.lock changed
check_run "yarn.lock" "yarn"
12 changes: 1 addition & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"files.insertFinalNewline": true,
Expand Down Expand Up @@ -35,9 +29,5 @@
"eslint.packageManager": "yarn",
"typescript.tsdk": "node_modules\\typescript\\lib",
"editor.tabSize": 2,
"cSpell.words": [
"Mixins",
"picgo",
"vspicgo"
]
"cSpell.words": ["Mixins", "picgo", "vspicgo"]
}
20 changes: 8 additions & 12 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
.vscode/**
.vscode-test/**
out/test/**
src/**
.gitignore
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
node_modules
out/
webpack.config.js
**
!dist
!logo.png
!README.md
!CHANGELOG.md
!LICENSE
!package.json
!package.nls.json
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
}
},
"scripts": {
"vscode:prepublish": "webpack --mode production",
"vscode:prepublish": "yarn && webpack --mode production",
"compile": "webpack --mode development",
"watch": "webpack --mode development --watch",
"test": "tsc -p ./ && node ./out/test/run-test.js",
Expand All @@ -304,7 +304,8 @@
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"post-merge": "sh .scripts/update_dependencies.sh"
}
},
"lint-staged": {
Expand Down
3 changes: 3 additions & 0 deletions src/vs-picgo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export default class VSPicgo extends EventEmitter {
''
)
urlText = urlText.trim()
if (!urlText) {
throw new Error('no image URL found in the output')
}
await this.updateData(ctx.output)
} catch (err) {
if (err instanceof SyntaxError) {
Expand Down
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const config = {
}
]
},
optimization: {
// We no not want to minimize our code.
minimize: false
},
plugins: [
// @ts-ignore
new CopyPlugin({
Expand Down

0 comments on commit 4d29687

Please sign in to comment.