From a5030f6dc6d2a8426bbcebd4d0bac7684178376e Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 26 Aug 2021 13:53:25 +0200 Subject: [PATCH] refactor --- .gitpod.yml | 5 +++-- build.sh | 25 ------------------------- entrypoint.sh | 5 ----- filter.py | 50 -------------------------------------------------- install.sh | 19 ------------------- run.sh | 13 ------------- 6 files changed, 3 insertions(+), 114 deletions(-) delete mode 100755 build.sh delete mode 100644 entrypoint.sh delete mode 100644 filter.py delete mode 100755 install.sh delete mode 100755 run.sh diff --git a/.gitpod.yml b/.gitpod.yml index 763c0dfdf..d1a057a95 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -7,9 +7,10 @@ tasks: bash /tmp/install.sh source /workspace/env.sh publtools_check - cd wiki_config && publishtools flatten + cd config + publishtools install cd .. - echo ' - do "./wiki_run" to run wiki.' + echo ' - do "publishtools run" to run website.' echo ' - do "open workspace.code-workspace" to open all relevant dirs in your editor.' ports: - port: 9998 diff --git a/build.sh b/build.sh deleted file mode 100755 index b0261b6c8..000000000 --- a/build.sh +++ /dev/null @@ -1,25 +0,0 @@ - - -source /home/gitpod/publisher/nvm.sh && nvm use --lts && export PATH=/home/gitpod/publisher/versions/node/v14.17.5/bin:$PATH - -set -e -cd /workspace/www_threefold_io - - -set +e -if [ -f vue.config.js ]; then - npm run-script build -else - gridsome build -fi - -set -e - -mkdir -p /home/gitpod/publisher/publish/ -rsync -ra --delete /workspace/www_threefold_io/dist/ /home/gitpod/publisher/publish// - -cd /workspace/www_threefold_io/dist - -#echo go to http://localhost:9999/ - #python3 -m http.server 9999 - diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index d23d594b5..000000000 --- a/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -systemctl start redis-server - -exec sh diff --git a/filter.py b/filter.py deleted file mode 100644 index 1798838e6..000000000 --- a/filter.py +++ /dev/null @@ -1,50 +0,0 @@ -import toml -import os -import shutil - -def getListOfFiles(dirName): - # create a list of file and sub directories - # names in the given directory - listOfFile = os.listdir(dirName) - allFiles = list() - # Iterate over all the entries - for entry in listOfFile: - # Create full path - fullPath = os.path.join(dirName, entry) - # If entry is a directory then get the list of files in this directory - if os.path.isdir(fullPath): - allFiles = allFiles + getListOfFiles(fullPath) - else: - allFiles.append(fullPath) - - return allFiles -def do(): - files = getListOfFiles("content") - for file in files: - if not file.endswith(".md"): - continue - - t = "" - start = False - - with open(file) as f: - for line in f: - if line.startswith("---"): - if not start: - start = True - continue - else: - break - - if line.startswith("private:"): - if line.replace("private:", "").strip() == "1": - shutil.rmtree(os.path.abspath(os.path.dirname(file))) - else: - continue - - - - - -if __name__ == "__main__": - do() \ No newline at end of file diff --git a/install.sh b/install.sh deleted file mode 100755 index a08971b2a..000000000 --- a/install.sh +++ /dev/null @@ -1,19 +0,0 @@ - - -source /home/gitpod/publisher/nvm.sh && nvm use --lts && export PATH=/home/gitpod/publisher/versions/node/v14.17.5/bin:$PATH - -set -e - -cd /workspace/www_threefold_io - -rm -f yarn.lock -rm -rf .cache - -if [ "true" = "true" ]; then - npm install - rsync -ra --delete node_modules/ /home/gitpod/publisher/node_modules/ -else - rsync -ra --delete /home/gitpod/publisher/node_modules/ node_modules/ - npm install -fi - diff --git a/run.sh b/run.sh deleted file mode 100755 index f2f2bc758..000000000 --- a/run.sh +++ /dev/null @@ -1,13 +0,0 @@ - - -source /home/gitpod/publisher/nvm.sh && nvm use --lts && export PATH=/home/gitpod/publisher/versions/node/v14.17.5/bin:$PATH - -set -e -cd /workspace/www_threefold_io - -if [ -f vue.config.js ]; then - npm run-script serve -else - gridsome develop -fi -