Skip to content

Instantly share code, notes, and snippets.

@compscitwilight
Last active November 25, 2023 15:56
Show Gist options
  • Select an option

  • Save compscitwilight/0f6f55f12a544b43979b1349cc0a2c10 to your computer and use it in GitHub Desktop.

Select an option

Save compscitwilight/0f6f55f12a544b43979b1349cc0a2c10 to your computer and use it in GitHub Desktop.

Revisions

  1. compscitwilight revised this gist Nov 25, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ts-electron-newproject.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ if [ -d bin/view ]
    then
    rm -rf bin/view
    fi
    cp -r src/view build
    cp -r src/view bin
    tsc src/*.ts --outDir bin
    echo \"Build completed\"
    " >> build.sh
  2. compscitwilight revised this gist Nov 25, 2023. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions ts-electron-newproject.sh
    Original file line number Diff line number Diff line change
    @@ -15,16 +15,16 @@ mkdir src/view

    touch build.sh
    echo "
    if [ -d build/view ]
    if [ -d bin/view ]
    then
    rm -rf build/view
    rm -rf bin/view
    fi
    cp -r src/view build
    tsc src/*.ts --outDir build
    tsc src/*.ts --outDir bin
    echo \"Build completed\"
    " >> build.sh

    touch src/index.ts
    echo "// This is the start of your Electron TypeScript project." >> src/index.ts
    echo "// To start the build process, run the build.sh script located in the root directory of this project." >> src/index.ts
    echo "// To start the build, run electron . in the root directory." >> src/index.ts
    echo "// To start the build, run electron . in the root directory." >> src/index.ts
  3. compscitwilight created this gist Nov 25, 2023.
    30 changes: 30 additions & 0 deletions ts-electron-newproject.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # !/bin/bash

    # This shell script automates the setup process of creating a barebones Electron project
    # w/ TypeSCript and TSC compiler scripts.

    echo "= Instantializing NPM project... =";
    npm init -y

    npm i electron
    npm i tsc typescript electron-packager --save-dev

    mkdir bin
    mkdir src
    mkdir src/view

    touch build.sh
    echo "
    if [ -d build/view ]
    then
    rm -rf build/view
    fi
    cp -r src/view build
    tsc src/*.ts --outDir build
    echo \"Build completed\"
    " >> build.sh

    touch src/index.ts
    echo "// This is the start of your Electron TypeScript project." >> src/index.ts
    echo "// To start the build process, run the build.sh script located in the root directory of this project." >> src/index.ts
    echo "// To start the build, run electron . in the root directory." >> src/index.ts