Removed the path type
This commit is contained in:
parent
ed406ca1ed
commit
7d009e266d
1788
desktop/package-lock.json
generated
Normal file
1788
desktop/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,17 +4,17 @@
|
|||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
"clean" : "rm -r ~/Desktop/Ronin-darwin-x64/ ; rm -r ~/Desktop/Ronin-linux-x64/ ; rm -r ~/Desktop/Ronin-win32-x64/ ; echo 'cleaned build location'",
|
"clean": "rm -r ~/Desktop/Ronin-darwin-x64/ ; rm -r ~/Desktop/Ronin-linux-x64/ ; rm -r ~/Desktop/Ronin-win32-x64/ ; echo 'cleaned build location'",
|
||||||
"build_osx" : "electron-packager . Ronin --platform=darwin --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.icns ; echo 'Built for OSX'",
|
"build_osx": "electron-packager . Ronin --platform=darwin --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.icns ; echo 'Built for OSX'",
|
||||||
"build_linux" : "electron-packager . Ronin --platform=linux --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.ico ; echo 'Built for LINUX'",
|
"build_linux": "electron-packager . Ronin --platform=linux --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.ico ; echo 'Built for LINUX'",
|
||||||
"build_win" : "electron-packager . Ronin --platform=win32 --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.ico ; echo 'Built for WIN'",
|
"build_win": "electron-packager . Ronin --platform=win32 --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.ico ; echo 'Built for WIN'",
|
||||||
"build" : "npm run clean ; npm run build_osx ; npm run build_linux ; npm run build_win",
|
"build": "npm run clean ; npm run build_osx ; npm run build_linux ; npm run build_win",
|
||||||
"push_osx" : "~/butler push ~/Desktop/Ronin-darwin-x64/ hundredrabbits/ronin:osx-64",
|
"push_osx": "~/butler push ~/Desktop/Ronin-darwin-x64/ hundredrabbits/ronin:osx-64",
|
||||||
"push_linux" : "~/butler push ~/Desktop/Ronin-linux-x64/ hundredrabbits/ronin:linux-64",
|
"push_linux": "~/butler push ~/Desktop/Ronin-linux-x64/ hundredrabbits/ronin:linux-64",
|
||||||
"push_win" : "~/butler push ~/Desktop/Ronin-win32-x64/ hundredrabbits/ronin:windows-64",
|
"push_win": "~/butler push ~/Desktop/Ronin-win32-x64/ hundredrabbits/ronin:windows-64",
|
||||||
"push_theme" : "~/butler push ~/Github/HundredRabbits/Themes/themes/ hundredrabbits/ronin:themes",
|
"push_theme": "~/butler push ~/Github/HundredRabbits/Themes/themes/ hundredrabbits/ronin:themes",
|
||||||
"push_status" : "~/butler status hundredrabbits/ronin",
|
"push_status": "~/butler status hundredrabbits/ronin",
|
||||||
"push" : "npm run build ; npm run push_theme ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run push_status"
|
"push": "npm run build ; npm run push_theme ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run push_status"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^5.0.6",
|
"electron": "^5.0.6",
|
||||||
|
@ -106,8 +106,14 @@ function Commander (ronin) {
|
|||||||
this.cache = this._input.value
|
this.cache = this._input.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.canInject = function () {
|
||||||
|
return this._input.value.indexOf('$path') > -1
|
||||||
|
}
|
||||||
|
|
||||||
this.injectPath = function (path) {
|
this.injectPath = function (path) {
|
||||||
this._input.value = this._input.value.replace('($path)', `(path "${path}")`)
|
if (this.canInject()) {
|
||||||
|
this._input.value = this._input.value.replace('$path', `"${path}"`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.commit = function () {
|
this.commit = function () {
|
||||||
|
@ -7,9 +7,8 @@ function Library (ronin) {
|
|||||||
this.folder = (path = ronin.source.path) => {
|
this.folder = (path = ronin.source.path) => {
|
||||||
const a = []
|
const a = []
|
||||||
if (path) {
|
if (path) {
|
||||||
const folder = ronin.source.folder(path)
|
if (fs.existsSync(path)) {
|
||||||
if (fs.existsSync(folder)) {
|
return fs.readdirSync(path)
|
||||||
return fs.readdirSync(folder)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return a
|
return a
|
||||||
@ -169,10 +168,6 @@ function Library (ronin) {
|
|||||||
return this.pos(rect.w / 2, rect.h / 2)
|
return this.pos(rect.w / 2, rect.h / 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.path = (path) => {
|
|
||||||
return path
|
|
||||||
}
|
|
||||||
|
|
||||||
this.scale = (rect, w, h) => {
|
this.scale = (rect, w, h) => {
|
||||||
return { x: rect.x, y: rect.y, w: rect.w * w, h: rect.h * h }
|
return { x: rect.x, y: rect.y, w: rect.w * w, h: rect.h * h }
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,9 @@ function Lisp (input, lib) {
|
|||||||
|
|
||||||
const special = {
|
const special = {
|
||||||
run: (input, context) => {
|
run: (input, context) => {
|
||||||
const file = fs.readFileSync(
|
const p = input[1].value
|
||||||
path.resolve(input[1].value),
|
if (!fs.existsSync(p)) { console.warn('Source', p); return [] }
|
||||||
{ encoding: 'utf-8' })
|
const file = fs.readFileSync(p, { encoding: 'utf-8' })
|
||||||
|
|
||||||
return interpret(this.parse(file), context)
|
return interpret(this.parse(file), context)
|
||||||
},
|
},
|
||||||
let: function (input, context) {
|
let: function (input, context) {
|
||||||
@ -31,7 +30,6 @@ function Lisp (input, lib) {
|
|||||||
acc.scope[x[0].value] = interpret(x[1], context)
|
acc.scope[x[0].value] = interpret(x[1], context)
|
||||||
return acc
|
return acc
|
||||||
}, new Context({}, context))
|
}, new Context({}, context))
|
||||||
|
|
||||||
return interpret(input[2], letContext)
|
return interpret(input[2], letContext)
|
||||||
},
|
},
|
||||||
def: function (input, context) {
|
def: function (input, context) {
|
||||||
@ -68,7 +66,6 @@ function Lisp (input, lib) {
|
|||||||
acc[x.value] = lambdaArguments[i]
|
acc[x.value] = lambdaArguments[i]
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
return interpret(input[2], new Context(lambdaScope, context))
|
return interpret(input[2], new Context(lambdaScope, context))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -92,12 +92,12 @@ function Ronin () {
|
|||||||
const file = e.dataTransfer.files[0]
|
const file = e.dataTransfer.files[0]
|
||||||
if (!file || !file.name) { console.warn('File', 'Not a valid file.'); return }
|
if (!file || !file.name) { console.warn('File', 'Not a valid file.'); return }
|
||||||
const path = file.path ? file.path : file.name
|
const path = file.path ? file.path : file.name
|
||||||
if (path.indexOf('.lisp') > -1) {
|
if (this.commander.canInject()) {
|
||||||
this.source.read(path)
|
|
||||||
this.commander.show()
|
|
||||||
} else if (file.path) {
|
|
||||||
this.commander.injectPath(file.path)
|
this.commander.injectPath(file.path)
|
||||||
this.commander.show()
|
this.commander.show()
|
||||||
|
} else if (path.indexOf('.lisp') > -1) {
|
||||||
|
this.source.read(path)
|
||||||
|
this.commander.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user