Skip to content

Commit

Permalink
πŸ› fix: bug with envs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rettend committed Jan 20, 2024
1 parent e1ea30c commit 729e81f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install
env:
SKIP_POSTINSTALL: true
UPLOAD_SCHEMA: true
run: nci

- name: Lint
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

# - name: Install eemoji
# run: pnpm i -g eemoji

- name: Install eemoji
env:
SKIP_POSTINSTALL: true
Expand All @@ -41,16 +41,10 @@ jobs:
run: pnpm run build

- name: Setup eemoji
run: pnpm i

- name: Link eemoji
run: pnpm link --global

- name: Print eemoji version
run: eemoji --version
run: node ./bin/eemoji.mjs init -c none

- name: Print ls
run: ls -la
run: ls -la .git/hooks

- name: Switch to test branch
run: git checkout -b test
Expand All @@ -67,4 +61,6 @@ jobs:
run: 'git commit --allow-empty -m ''test: eemoji'''

- name: Check the commit message for emoji
run: git log -1 --pretty=%B | grep -q "πŸ‘"
run: |
git log -1
git log -1 --pretty=%B | grep -q "πŸ‘"
17 changes: 7 additions & 10 deletions bin/postinstall.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
const process = require('node:process')
const fs = require('node:fs')
const exec = require('node:child_process').exec
const platform = require('node:os').platform()

if (process.env.SKIP_POSTINSTALL) {
if (platform === 'linux') {
const schema = require('./../json/eemoji-config-schema.json')
const emojis = require('./../src/emojis.json')
if (process.env.UPLOAD_SCHEMA) {
const schema = require('./../json/eemoji-config-schema.json')
const emojis = require('./../src/emojis.json')

schema.properties.emojis.default = emojis
schema.properties.emojis.default = emojis

fs.writeFileSync('./json/eemoji-config-schema.json', `${JSON.stringify(schema, null, 2)}\n`)
}
fs.writeFileSync('./json/eemoji-config-schema.json', `${JSON.stringify(schema, null, 2)}\n`)
}
else {
else if (!process.env.SKIP_POSTINSTALL) {
exec('node ./bin/eemoji.mjs init -c none', (err, stdout) => {
if (err)
console.error(err)
else
elsenode ./bin/eemoji.mjs init -c none
console.log(stdout)
})
}

0 comments on commit 729e81f

Please sign in to comment.