Skip to content

Commit

Permalink
fix tabs when project is closed, pass env to child ssc
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed Apr 18, 2024
1 parent 1664e83 commit bd8b218
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ async function main (argv) {
}

const target = process.env.PREFIX
if (!target) {
console.log('This script should not be run directly. It will be run by the SSC command.')
process.exit(0)
}

const opts = {
...params,
Expand Down
3 changes: 2 additions & 1 deletion socket.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
; copy_map = src/mapping.ini

; An list of environment variables, separated by commas.
env = HOME, USER, TMPDIR, PWD, DEBUG, RESET
env = HOME, USER, TMPDIR, PWD, DEBUG, RESET, VERBOSE

; Advanced Compiler Settings (ie C++ compiler -02, -03, etc).
flags = -O3
Expand All @@ -52,6 +52,7 @@ script = "node build.js"
[env]
DEV = true


[build.script]
; If true, it will pass build arguments to the build script. WARNING: this could be deprecated in the future.
; default value: false
Expand Down
4 changes: 4 additions & 0 deletions src/css/component-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ editor-tabs header.component::-webkit-scrollbar {
display: none;
}

editor-tabs.inset header {
padding-left: 80px;
}

editor-tabs .tab {
display: flex;
align-items: center;
Expand Down
21 changes: 18 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ class AppView extends Tonic {
const args = [
'build',
'-r'
// TODO allow config for -w
]

const coDevice = document.querySelector('#device')
Expand All @@ -506,7 +505,8 @@ class AppView extends Tonic {

term.info('Running new instance of app')
const cwd = this.state.currentProject.id
const c = this.childprocess = await spawn('ssc', args, { cwd })
const env = { SSC_PARENT_LOG_SOCKET: process.env.SSC_LOG_SOCKET }
const c = this.childprocess = await spawn('ssc', args, { cwd, env })

c.stdout.on('data', data => {
term.writeln(Buffer.from(data).toString().trim())
Expand Down Expand Up @@ -638,7 +638,22 @@ class AppView extends Tonic {
}

case 'Toggle Project': {
document.querySelector('#split-editor').toggle('left')
const coSplit = document.querySelector('#split-editor')
coSplit.toggle('left')

//
// if the project has been closed, we dont want the tabs to
// go under the traffic lights.
//
if (process.platform === 'darwin') {
const coTabs = document.querySelector('#editor-tabs')
if (coSplit.firstElementChild.style.visibility === 'hidden') {
coTabs.classList.add('inset')
} else {
coTabs.classList.remove('inset')
}
}

break
}

Expand Down

0 comments on commit bd8b218

Please sign in to comment.