diff --git a/fri/server/main.py b/fri/server/main.py
index 0e6de2c..fa09a18 100644
--- a/fri/server/main.py
+++ b/fri/server/main.py
@@ -3,6 +3,7 @@
import os
from subprocess import call
from pathlib import Path
+import json
app = Flask(__name__)
@@ -145,7 +146,7 @@ def download(dir):
return resp
-@app.route('/destroy/
', methods=['POST'])
+@app.route('/destroy/', methods=['DELETE'])
def destroy(dir):
cur_path = os.getcwd()
concore_path = os.path.abspath(os.path.join(cur_path, '../../'))
@@ -157,7 +158,21 @@ def destroy(dir):
else:
resp = jsonify({'message': 'There is an Error'})
resp.status_code = 500
- return resp
+ return resp
+
+@app.route('/getFilesList/', methods=['POST'])
+def getFilesList(dir):
+ cur_path = os.getcwd()
+ concore_path = os.path.abspath(os.path.join(cur_path, '../../'))
+ dir_path = os.path.abspath(os.path.join(concore_path, dir))
+ res = []
+
+ if(dir=='concore'):
+ res = os.listdir(concore_path)
+ else:
+ res = os.listdir(dir_path)
+ res2 = json.dumps(res)
+ return res2
if __name__ == "__main__":
diff --git a/fri/test.py b/fri/test.py
index f552c11..8384597 100644
--- a/fri/test.py
+++ b/fri/test.py
@@ -46,38 +46,27 @@ def download():
# function to check build
def build():
url = "http://127.0.0.1:5000/build/test?fetch=sample1"
-
- payload={'': ''}
- files=[]
- headers = {}
-
- response = requests.request("POST", url, headers=headers, data=payload, files=files)
-
+ response = requests.request("POST", url)
print(response.text)
# function to debug
def debug():
url = "http://127.0.0.1:5000/debug/sample1"
-
- payload={'': ''}
- files=[]
- headers = {}
-
- response = requests.request("POST", url, headers=headers, data=payload, files=files)
-
+ response = requests.request("POST", url)
print(response.text)
#function to destroy dir.
def destroy():
url = "http://127.0.0.1:5000/destroy/sample1"
-
- payload={'': ''}
- files=[]
- headers = {}
-
- response = requests.request("POST", url, headers=headers, data=payload, files=files)
-
+ response = requests.request("DELETE", url)
+
+ print(response.text)
+
+def getFilesList():
+ import requests
+ url = "http://127.0.0.1:5000/getFilesList/test"
+ response = requests.request("POST", url)
print(response.text)
@@ -87,4 +76,5 @@ def destroy():
# build()
# debug()
# destroy()
+getFilesList()
diff --git a/mkconcore.py b/mkconcore.py
index b971733..4332f23 100644
--- a/mkconcore.py
+++ b/mkconcore.py
@@ -595,6 +595,9 @@
#remaining code deals only with posix or windows
#copy sourcefiles from ./src into corresponding directories
+if concoretype=="posix":
+ fbuild.write('#!/bin/bash' + "\n")
+
for node in nodes_dict:
containername,sourcecode = nodes_dict[node].split(':')
if len(sourcecode)!=0:
@@ -678,6 +681,9 @@
i=i+1
#start running source in associated dirs (run and debug scripts)
+if concoretype=="posix":
+ fdebug.write('#!/bin/bash' + "\n")
+
i=0
for node in nodes_dict:
containername,sourcecode = nodes_dict[node].split(':')
@@ -769,7 +775,9 @@
else:
fdebug.write('concorewd=`pwd`\n')
fdebug.write('osascript -e "tell application \\"Terminal\\" to do script \\"cd $concorewd/' +containername+";"+ MATLABEXE+' -batch run\\\\\\(\\\\\\'+"'"+sourcecode+"\\\\\\'"+'\\\\\\)\\""\n' )
-
+
+if concoretype=="posix":
+ fstop.write('#!/bin/bash' + "\n")
i=0 # 3/30/21
for node in nodes_dict:
containername,sourcecode = nodes_dict[node].split(':')
@@ -784,6 +792,8 @@
i=i+1
fstop.close()
+if concoretype=="posix":
+ fclear.write('#!/bin/bash' + "\n")
i=0 # 9/13/21
for node in nodes_dict:
containername,sourcecode = nodes_dict[node].split(':')
@@ -799,6 +809,8 @@
i=i+1
fclear.close()
+if concoretype=="posix":
+ fmaxtime.write('#!/bin/bash' + "\n")
i=0 # 9/12/21
for node in nodes_dict:
containername,sourcecode = nodes_dict[node].split(':')