-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpublish.sh
executable file
·49 lines (40 loc) · 1.45 KB
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Doing this b/c apm's publishing process has repeatedly confounded me:
# https://github.com/atom/apm/issues/756
VERSION="$(jq -r '"v"+.version' package.json)"
read -p "Enter version to publish (Return for default: $VERSION) " entered
if [[ -n "$entered" ]]; then
VERSION="$entered"
fi
read -s -p 'Enter Atom token (https://atom.io/account): ' ATOM_TOKEN
echo
echo ----------
echo
curl -i \
-H "authorization: $ATOM_TOKEN" \
-H "accept: application/json" \
-H "content-type: application/json" \
-X POST -d "{\"tag\":\"$VERSION\"}" \
'https://atom.io/api/packages/seeing-is-believing/versions'
# ----- Logged from within apm -----
# Publishing seeing-is-believing@v13.0.0 { packageName: 'seeing-is-believing',
# tag: 'v13.0.0',
# options: { rename: undefined },
# error: null,
# token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
# requestSettings:
# { url: 'https://atom.io/api/packages/seeing-is-believing/versions', <-- that's a bug, wrong protocol
# json: true,
# body: { tag: 'v13.0.0', rename: undefined },
# headers: { authorization: '_YzKoVEZDCoLPQhdQL6nAmg' } } }
# ----- Should ultimately do this -----
# POST /packages/seeing-is-believing/versions HTTP/1.1
# authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
# User-Agent: npm/3.10.10 node/v6.9.5 darwin x64
# host: localhost:3004
# accept: application/json
# content-type: application/json
# content-length: 17
# Connection: close
#
# {"tag":"v14.0.0"}