Git Product home page Git Product logo

Comments (7)

Gawdl3y avatar Gawdl3y commented on June 14, 2024

atom/atom#3339 would make associating commands with a file type much simpler.

from atom-build.

noseglid avatar noseglid commented on June 14, 2024

One easy way of accomplishing this would be to use a Makefile, with a target which depends on all your source files. GNU Make will only execute the build target for files which have been altered since the last time make was executed - thus only building one file if you only changed one. For instance:

SRCS  = a.coffee b.coffee
JS = $(SRCS:.coffee=.js)

all: $(JS)

%.js: %.coffee
        ./node_modules/coffee-script/bin/coffee --compile $^

Would this help you?

from atom-build.

Gawdl3y avatar Gawdl3y commented on June 14, 2024

That's certainly useful for situations where you have an organized directory of files, but when you're just editing a one-off file, it's not particularly convenient to have to create a makefile for it.

Also, take for example modding the popular PC game The Elder Scrolls V: Skyrim. Typically, script editing is done right in the game's /Data/Scripts/Source directory, which contains every single script file for anything in the game. The makefile idea would break down here, as it'd first have to run through every single one of those files (hundreds, thousands probably). If all you want to do is compile a single script, that's massive overkill.

This situation with Skyrim is actually why I'd like the ability to build single files. The Papyrus Compiler executable takes a script path as a parameter, and an output path. The output path is typically constant, you'd never change it; but the input file would need to be the currently focused file in Atom when you run the build command, or a file that you right-click on to run it. In order to specify this in the package's config, there'd need to be some kind of replacement token like {FILEPATH} for the parameters.

Associating the "psc" extension with a build command with the package without a config file in each directory that contains them would be even easier, but probably more complex.

I know the use-case I provided is fairly specific, but I believe there are plenty of others out there.

from atom-build.

noseglid avatar noseglid commented on June 14, 2024

I'm gonna have a look at this. Just to clarify the need; what you need is a way to specify which build is the currently active one in your editor. For instance, if you used the following .atom-build.json:

{
  "cmd": "cp",
  "args": "{ACTIVE_FILE} /home/user/www/public/"
}

And if atom-build replaced {ACTIVE_FILE} with the file currently edited, then it would in fact execute the command (if the active file is index.html)

cp index.html /home/user/www/public/

Did I correctly understand your need?

from atom-build.

Gawdl3y avatar Gawdl3y commented on June 14, 2024

Yep, that's basically it - though it should probably use the full file path, rather than a relative one.
I actually hacked together a quick single-purpose version of this package for Papyrus for my own purposes, but it'd be great to see support for this kind of thing "officially". ;)

from atom-build.

noseglid avatar noseglid commented on June 14, 2024

I'd love to see what you did. If possible, feel free to submit a PR.

Full path is a good. Maybe even two different replace options where one gives relative to project root, and one is the fully qualified path.

from atom-build.

noseglid avatar noseglid commented on June 14, 2024

Fixed with 7feea45. Will be available in v0.9.0

from atom-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.