-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (79 loc) · 2.67 KB
/
Makefile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
# Makefile #
############################################################
##
## Glob Updating
##
## Created by glob-update
## Copyright (C) 2016-2017
##
############################################################
#
# cURL #
## Path of cURL
CURL_PATH=curl
## show details(flag, if don't want => spaces)
CURL_DELTAIL=' -i '
# SHELL #
## The shell will be used
SHELL=bash
## The echo or some things like that
ECHO=echo
# SITE #
## URL of site
SITE_URL=https://blog.qinka.pro
## Private key file
PRIVATE_KEY=../../.ssh/qinka-2048-151
## The path of glob-ih
IH_PATH=glob-ih
## The delay between server and glob-ih
IH_DELAY=0
## Get the time of now via glob-ih or date
IH_NOW=$$($(IH_PATH) -t)
## Check the delay
TIMECHECK_PATH=glob-timecheck
## Delta of site's check
SITE_DELTA=6
## Site Theme
SITE_THEME=hack
CODE_THEME=default
# TIME CHECK #
check-delay:
@$(ECHO)
@$(ECHO) check time
@$(ECHO) $(CURL_PATH) -X GET $(SITE_URL)/@/~servertime | $(SHELL) | $(TIMECHECK_PATH)
@$(ECHO)
# clean #
clean-tmp:
@$(ECHO) Clean .ignore/tmp.*
@rm -rf .ignore/tmp.*
@$(ECHO) DONE
# Change Site Theme #
change-site-theme:
OLD=$($(CURL_PATH) -X GET $(SITE_URL)/@/~site-theme)
@if [ "$(OLD)" = "{\"error\":\"not found\"}" ]; then OLD="";fi;
@$(ECHO) The old theme is $(OLD_THEME)
@$(ECHO) The new theme is $(SITE_STYLE)
@if [ "$(OLD)" = "$(SITE_STYLE)" ]; then $(ECHO) The new one is eq2 old one. DO NOTHING; \
else $(ECHO) $(CURL_PATH) $(CURL_DETAIL) -X PUT -F \"sha-file-name=/`$(MD5) $(PRIVATE_KEY).pub`\" -F \"var=$(SITE_STYLE)\" -F \"type=query\" -F \"create-time=2017-03-12 06:50:38.716417 UTC\" -F \"update-time=$(IH_NOW)\" -F \"title=query\" \
$(SITE_URL)/@/~site-theme ' ' | $(IH_PATH) -m -f$(IH_DELAY) -p$(PRIVATE_KEY) -d$(SITE_DELTA) -v | $(SHELL) ; fi
# Change Site Code Highlight #
change-code-highlight:
OLD=$($(CURL_PATH) -X GET $(SITE_URL)/@/~highlight)
@if [ "$(OLD)" = "{\"error\":\"not found\"}" ]; then OLD="";fi;
@$(ECHO) The old theme is $(OLD_THEME)
@$(ECHO) The new theme is $(CODE_STYLE)
@if [ "$(OLD)" = "$(CODE_STYLE)" ]; then $(ECHO) The new one is eq2 old one. DO NOTHING; \
else $(ECHO) $(CURL_PATH) $(CURL_DETAIL) -X PUT -F \"sha-file-name=/`$(MD5) $(PRIVATE_KEY).pub`\" -F \"var=$(CODE_STYLE)\" -F \"type=query\" -F \"create-time=2017-03-12 06:50:38.716417 UTC\" -F \"update-time=$(IH_NOW)\" -F \"title=query\" \
$(SITE_URL)/@/~highlight ' ' | $(IH_PATH) -m -f$(IH_DELAY) -p$(PRIVATE_KEY) -d$(SITE_DELTA) -v | $(SHELL) ; fi
include frame-dev.mk
include navs.mk
include post-gaming.mk
include .platform/platform.mk
include deeplearning.mk
include post-docker.mk
include post-euterpea.mk
include post-fpga.mk
include post-haskell.mk
include post-os.mk
include post-unameplus.mk