Compare commits
3 Commits
v0.4.3
...
3fc8601344
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fc8601344 | |||
| 635cdd4b24 | |||
| 76368f154e |
@@ -134,14 +134,14 @@ check-app-name:
|
|||||||
(echo "app_name is empty - is 'xpath' (libxml2-utils/perl-XML-XPath) installed?" >&2; exit 1)
|
(echo "app_name is empty - is 'xpath' (libxml2-utils/perl-XML-XPath) installed?" >&2; exit 1)
|
||||||
|
|
||||||
.PHONY: source
|
.PHONY: source
|
||||||
source: check-app-name check-clean-tree
|
source: check-app-name check-clean-tree check-on-branch
|
||||||
rm -rf $(source_build_directory)
|
rm -rf $(source_build_directory)
|
||||||
mkdir -p $(source_build_directory)
|
mkdir -p $(source_build_directory)
|
||||||
git archive --format=tar --prefix=$(app_name)/ HEAD | gzip > $(source_package_name).tar.gz
|
git archive --format=tar --prefix=$(app_name)/ HEAD | gzip > $(source_package_name).tar.gz
|
||||||
|
|
||||||
# Builds the source package for the app store, ignores php and js tests
|
# Builds the source package for the app store, ignores php and js tests
|
||||||
.PHONY: appstore
|
.PHONY: appstore
|
||||||
appstore: check-app-name check-clean-tree
|
appstore: check-app-name check-clean-tree check-on-branch
|
||||||
rm -rf $(appstore_build_directory)
|
rm -rf $(appstore_build_directory)
|
||||||
mkdir -p $(appstore_build_directory)
|
mkdir -p $(appstore_build_directory)
|
||||||
git archive --format=tar --prefix=$(app_name)/ HEAD | gzip > $(appstore_package_name).tar.gz
|
git archive --format=tar --prefix=$(app_name)/ HEAD | gzip > $(appstore_package_name).tar.gz
|
||||||
@@ -178,8 +178,21 @@ check-clean-tree:
|
|||||||
@git diff --quiet HEAD -- || \
|
@git diff --quiet HEAD -- || \
|
||||||
(echo "Uncommitted changes to tracked files - commit before releasing (see 'git status')." >&2; exit 1)
|
(echo "Uncommitted changes to tracked files - commit before releasing (see 'git status')." >&2; exit 1)
|
||||||
|
|
||||||
|
# `git archive HEAD` packages whatever commit the checkout currently points
|
||||||
|
# to, regardless of branch - check-clean-tree only guards against *uncommitted*
|
||||||
|
# changes, not against HEAD being the wrong branch entirely (a feature branch,
|
||||||
|
# an old tag, a PR checkout, a detached HEAD). Override for the rare
|
||||||
|
# intentional case (e.g. releasing from a branch on purpose):
|
||||||
|
# make appstore RELEASE_BRANCH=some-branch
|
||||||
|
RELEASE_BRANCH ?= main
|
||||||
|
|
||||||
|
.PHONY: check-on-branch
|
||||||
|
check-on-branch:
|
||||||
|
@test "$$(git rev-parse --abbrev-ref HEAD)" = "$(RELEASE_BRANCH)" || \
|
||||||
|
(echo "HEAD is on '$$(git rev-parse --abbrev-ref HEAD)', not '$(RELEASE_BRANCH)' - pass RELEASE_BRANCH=<branch> to override if this is intentional." >&2; exit 1)
|
||||||
|
|
||||||
.PHONY: version
|
.PHONY: version
|
||||||
version: check-clean-tree
|
version: check-clean-tree check-on-branch
|
||||||
@echo "Creating version v$(VERSION)"
|
@echo "Creating version v$(VERSION)"
|
||||||
@git tag v$(VERSION)
|
@git tag v$(VERSION)
|
||||||
@git push $(RELEASE_REMOTE) v$(VERSION)
|
@git push $(RELEASE_REMOTE) v$(VERSION)
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<name>Extended OCC Web</name>
|
<name>Extended OCC Web</name>
|
||||||
<summary>OCC Commands in a web terminal</summary>
|
<summary>OCC Commands in a web terminal</summary>
|
||||||
<description><![CDATA[Run OCC Commands in a web terminal]]></description>
|
<description><![CDATA[Run OCC Commands in a web terminal]]></description>
|
||||||
<version>0.4.3</version>
|
<version>0.4.4</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author mail="dillard.blom@ensembia.com" >Dillard Blom</author>
|
<author mail="dillard.blom@ensembia.com" >Dillard Blom</author>
|
||||||
<namespace>OCCWeb</namespace>
|
<namespace>OCCWeb</namespace>
|
||||||
|
|||||||
+15
-1
@@ -14,6 +14,17 @@
|
|||||||
}
|
}
|
||||||
var baseUrl = OC.generateUrl('/apps/extended_occweb');
|
var baseUrl = OC.generateUrl('/apps/extended_occweb');
|
||||||
|
|
||||||
|
// occ output is plain text with ANSI colors, but jQuery Terminal reads
|
||||||
|
// "[" and "]" as its own formatting syntax. Escape the brackets in the
|
||||||
|
// text (e.g. Symfony's "[alias]" in `occ list`) and leave the ANSI
|
||||||
|
// sequences alone, so from_ansi can still turn them into colors. This
|
||||||
|
// only works together with unixFormattingEscapeBrackets (see below).
|
||||||
|
function escapeOutputBrackets(output) {
|
||||||
|
return String(output).replace(/(\x1B\[[0-9;]*[A-Za-z])|[\[\]]/g, function (match, ansi) {
|
||||||
|
return ansi ? ansi : (match === '[' ? '[' : ']');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Current terminal mode: 'occ' (regular occ commands) or 'sql'
|
// Current terminal mode: 'occ' (regular occ commands) or 'sql'
|
||||||
// (running arbitrary SQL queries via /db/query).
|
// (running arbitrary SQL queries via /db/query).
|
||||||
var mode = 'occ';
|
var mode = 'occ';
|
||||||
@@ -386,7 +397,7 @@
|
|||||||
headers: { requesttoken: OC.requestToken },
|
headers: { requesttoken: OC.requestToken },
|
||||||
data: JSON.stringify(occCommand)
|
data: JSON.stringify(occCommand)
|
||||||
}).done(function (response) {
|
}).done(function (response) {
|
||||||
term.echo('\n' + response).resume();
|
term.echo('\n' + escapeOutputBrackets(response)).resume();
|
||||||
}).fail(function (xhr, status) {
|
}).fail(function (xhr, status) {
|
||||||
term.echo('\n[[;#ff5555;]Request failed: ]' + $.terminal.escape_formatting(xhr.status + ' ' + xhr.statusText)).resume();
|
term.echo('\n[[;#ff5555;]Request failed: ]' + $.terminal.escape_formatting(xhr.status + ' ' + xhr.statusText)).resume();
|
||||||
});
|
});
|
||||||
@@ -398,6 +409,9 @@
|
|||||||
name: 'occ',
|
name: 'occ',
|
||||||
prompt: OCC_PROMPT,
|
prompt: OCC_PROMPT,
|
||||||
completion: response,
|
completion: response,
|
||||||
|
// The overtyping and from_ansi formatters unescape brackets before
|
||||||
|
// parsing; this makes them escape the text again afterwards.
|
||||||
|
unixFormattingEscapeBrackets: true,
|
||||||
keydown: function (e) {
|
keydown: function (e) {
|
||||||
// Shift+Enter inserts a newline instead of running the command,
|
// Shift+Enter inserts a newline instead of running the command,
|
||||||
// letting you type multi-line SQL scripts in sql mode.
|
// letting you type multi-line SQL scripts in sql mode.
|
||||||
|
|||||||
Reference in New Issue
Block a user