-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshopify-cli-aliases.bash
More file actions
60 lines (48 loc) · 1.54 KB
/
shopify-cli-aliases.bash
File metadata and controls
60 lines (48 loc) · 1.54 KB
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
50
51
52
53
54
55
56
57
58
59
60
# Aliases for Shopify CLI
# Relies on folder naming convention [shopify-store-name]-shopify
function std() {
local current_store=${PWD##*/}
# current _store e.g. = "store-name-shopify"
# remove "-shopify" from the end
current_store=${current_store%"-shopify"}
export SHOPIFY_FLAG_STORE=$current_store
# set current_store to all uppercase
current_store=$(echo $current_store | tr '[:lower:]' '[:upper:]')
echo " Work on $current_store? (Y/n)"
read answer
if [[ $answer != "n" && $answer != "N" ]]
then
echo " Sync customizer changes? (Y/n)"
read syncAnswer
if [[ $syncAnswer != "n" && $syncAnswer != "N" ]]
then
shopify theme dev --poll --theme-editor-sync --open
else
shopify theme dev --poll --open
fi
fi
}
function stpl() {
local current_store=${PWD##*/}
# current _store e.g. = "store-name-shopify"
# remove "-shopify" from the end
current_store=${current_store%"-shopify"}
export SHOPIFY_FLAG_STORE=$current_store
# set current_store to all uppercase
current_store=$(echo $current_store | tr '[:lower:]' '[:upper:]')
echo " Working on $current_store"
echo
shopify theme pull $1
}
function stph() {
local current_store=${PWD##*/}
# current _store e.g. = "store-name-shopify"
# remove "-shopify" from the end
current_store=${current_store%"-shopify"}
export SHOPIFY_FLAG_STORE=$current_store
# set current_store to all uppercase
current_store=$(echo $current_store | tr '[:lower:]' '[:upper:]')
echo " Working on $current_store"
echo
shopify theme push
}